Commit a08507ec authored by Ramon Nou's avatar Ramon Nou
Browse files

Add Bash file creation test

parent de52d833
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -145,3 +145,13 @@ test rm rmdir mkdir:
    paths:
     - "${LOG_PATH}"

test bash file creation:
  stage: test
  script:
    - mkdir -p "${LOG_PATH}"
    - ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
    - sleep 4
    - LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BASH}/bash_testing2.sh /tmp/mountdir
  artifacts:
    paths:
     - "${LOG_PATH}"
 No newline at end of file

test/bash_testing2.sh

0 → 100644
+23 −0
Original line number Diff line number Diff line
#!/bin/bash
ROOT=${1}

echo Creating a file from a echo with content foo
echo "foo" > $ROOT/a.out

if [ -f $ROOT/a.out ]; 
     then
     echo File exists
     echo is the content correct?
     if grep -Fxq "foo" $ROOT/a.out
     then
            echo "String found"
     else
            echo "String not found"
            exit 1
     fi
     else
        echo File does not exists
        exit 1
fi

exit 0
 No newline at end of file