Skip to content

Commit

Permalink
Merge pull request #2219 from alan-turing-institute/fix_smoke_tests
Browse files Browse the repository at this point in the history
Update smoke tests for new mount locations
  • Loading branch information
JimMadge authored Oct 7, 2024
2 parents 1d72e42 + 25c7d00 commit dddf0c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,24 @@ check_db_credentials() {

# Mounted drives
# --------------
@test "Mounted drives (/data)" {
run bash test_mounted_drives.sh -d data
@test "Mounted drives (/mnt/input)" {
run bash test_mounted_drives.sh -d mnt/input
[ "$status" -eq 0 ]
}
@test "Mounted drives (/home)" {
run bash test_mounted_drives.sh -d home
[ "$status" -eq 0 ]
}
@test "Mounted drives (/output)" {
run bash test_mounted_drives.sh -d output
@test "Mounted drives (/mnt/output)" {
run bash test_mounted_drives.sh -d mnt/output
[ "$status" -eq 0 ]
}
@test "Mounted drives (/shared)" {
run bash test_mounted_drives.sh -d shared
@test "Mounted drives (/mnt/shared)" {
run bash test_mounted_drives.sh -d mnt/shared
[ "$status" -eq 0 ]
}
@test "Mounted drives (/var/local/ansible)" {
run bash test_mounted_drives.sh -d var/local/ansible
[ "$status" -eq 0 ]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CAN_DELETE="$([[ "$(touch "${directory_path}/${testfile}" 2>&1 1>/dev/null && rm

# Check that permissions are as expected for each directory
case "$directory" in
data)
mnt/input)
if [ "$CAN_CREATE" = 1 ]; then echo "Able to create files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_WRITE" = 1 ]; then echo "Able to write files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_DELETE" = 1 ]; then echo "Able to delete files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
Expand All @@ -38,18 +38,24 @@ case "$directory" in
if [ "$CAN_DELETE" = 0 ]; then echo "Unable to delete files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
;;

output)
mnt/output)
if [ "$CAN_CREATE" = 0 ]; then echo "Unable to create files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_WRITE" = 0 ]; then echo "Unable to write files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_DELETE" = 0 ]; then echo "Unable to delete files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
;;

shared)
mnt/shared)
if [ "$CAN_CREATE" = 0 ]; then echo "Unable to create files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_WRITE" = 0 ]; then echo "Unable to write files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_DELETE" = 0 ]; then echo "Unable to delete files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
;;

var/local/ansible)
if [ "$CAN_CREATE" = 1 ]; then echo "Able to create files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_WRITE" = 1 ]; then echo "Able to write files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
if [ "$CAN_DELETE" = 1 ]; then echo "Able to delete files in ${directory_path}!"; nfailed=$((nfailed + 1)); fi
;;

*)
echo "Usage: $0 -d [directory]"
exit 1
Expand Down

0 comments on commit dddf0c9

Please sign in to comment.