diff --git a/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/run_all_tests.bats b/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/run_all_tests.bats index bc73d824f7..5ce9692c67 100644 --- a/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/run_all_tests.bats +++ b/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/run_all_tests.bats @@ -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 ] } diff --git a/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/test_mounted_drives.sh b/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/test_mounted_drives.sh index a1812934b9..c74a7b4b48 100644 --- a/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/test_mounted_drives.sh +++ b/data_safe_haven/resources/workspace/ansible/files/usr/local/smoke_tests/test_mounted_drives.sh @@ -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 @@ -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