From d2b04870063690ea9841e98672b18e44173ec7ba Mon Sep 17 00:00:00 2001 From: George Xanthakis Date: Sat, 5 Nov 2022 12:29:45 +0200 Subject: [PATCH] Test extract turnin owner permissions --- .github/workflows/main.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63c6494..845df0f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,14 +3,16 @@ name: turnin test suite on: push: paths: - - 'src/**' - - 'Makefile' - - '.github/workflows/main.yml' + - "src/**" + - "Makefile" + - ".github/workflows/main.yml" + - "scripts/**" pull_request: paths: - - 'src/**' - - 'Makefile' - - '.github/workflows/main.yml' + - "src/**" + - "Makefile" + - ".github/workflows/main.yml" + - "scripts/**" env: COURSE: hy999 @@ -36,4 +38,13 @@ jobs: run: | verify-turnin ex1@$COURSE sudo -u $COURSE find /home/$COURSE/TURNIN/ex1/ - sudo -u $COURSE find /home/$COURSE/TURNIN/ex1/ | grep `whoami` > /dev/null \ No newline at end of file + sudo -u $COURSE find /home/$COURSE/TURNIN/ex1/ | grep `whoami` > /dev/null + - name: Verify extract turn in permissions + run: | + set -x + cp scripts/extract-turnins /home/$COURSE/TURNIN/ex1 + cd /home/$COURSE/TURNIN/ex1 + sudo -u $COURSE ./extract-turnins + FILE_PERMS=$(sudo -u $COURSE stat -L -c "%a %G %U" /home/$COURSE/TURNIN/ex1/runner/src/turnin.c | sudo -u $COURSE grep -o "600") + echo "$FILE_PERMS" + [ $FILE_PERMS -eq 600 ] || test $? -eq 0