Loading .gitlab-ci.yml +12 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ variables: BUILD_PATH: "${CI_PROJECT_DIR}/gkfs/build" INSTALL_PATH: "${CI_PROJECT_DIR}/gkfs/install" TESTS_BUILD_PATH: "${CI_PROJECT_DIR}/test/build" TESTS_BASH: "${CI_PROJECT_DIR}/test" LOG_PATH: "${CI_PROJECT_DIR}/logs" LD_LIBRARY_PATH: "${CI_PROJECT_DIR}/deps/install/lib;${CI_PROJECT_DIR}/deps/install/lib64" # Configuration variables Loading Loading @@ -127,3 +128,14 @@ test lseek: paths: - "${LOG_PATH}" test rm rmdir mkdir: 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_testing.sh /tmp/mountdir artifacts: paths: - "${LOG_PATH}" test/bash_testing.sh 0 → 100755 +83 −0 Original line number Diff line number Diff line #!/bin/bash ROOT=${1} DIR=${ROOT}/nonexist_deep0 echo Removing a nonexist file rm -rvf ${DIR}/nonexist_deep1 retval=$? echo Remove non exising directory result : $retval if [ $retval -ne 0 ]; then exit 1 fi if [ -d $DIR/nonexist2_deep1 ]; then echo Nonexist2 exists -error- exit 1 fi mkdir -vp $DIR/nonexist2_deep1 retval=$? echo Creating directory nonexist_deep0/nonexist2_deep1 result : $retval if [ $retval -ne 0 ]; then exit 1 fi if [ -d $DIR/nonexist2_deep1 ]; then echo nonexist_deep0/nonexist2_deep1 exists -ok!- rm -vrf ${DIR}/nonexist2_deep1/* retval=$? echo Removing content inside nonexist2_deep1 result : $retval if [ $retval -ne 0 ]; then exit 1 fi rm -vrf ${DIR}/nonexist2_deep1 retval=$? echo Removing directory nonexist2_deep1 using rm : $retval if [ $retval -ne 0 ]; then exit 1 fi fi if [ -d $DIR/nonexist2_deep1 ]; then echo nonexist2_deep1 exist -error- exit 1 fi rmdir -v ${DIR}/nonexist_deep1 retval=$? echo rmdir result for a nonexisting directory, expect 1, result: $retval if [ $retval -ne 1 ]; then exit 1 fi if [ -d ${DIR}/nonexist_deep1 ]; then echo nonexist exist -error- exit 1 fi rm -vrf ${ROOT}/* retval=$? echo removing all contents of ${ROOT}, result: $retval if [ $retval -ne 0 ]; then exit 1 fi if [ -d ${DIR} ]; then echo directory not empty -error- exit 1 fi echo All ok! exit 0 Loading
.gitlab-ci.yml +12 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ variables: BUILD_PATH: "${CI_PROJECT_DIR}/gkfs/build" INSTALL_PATH: "${CI_PROJECT_DIR}/gkfs/install" TESTS_BUILD_PATH: "${CI_PROJECT_DIR}/test/build" TESTS_BASH: "${CI_PROJECT_DIR}/test" LOG_PATH: "${CI_PROJECT_DIR}/logs" LD_LIBRARY_PATH: "${CI_PROJECT_DIR}/deps/install/lib;${CI_PROJECT_DIR}/deps/install/lib64" # Configuration variables Loading Loading @@ -127,3 +128,14 @@ test lseek: paths: - "${LOG_PATH}" test rm rmdir mkdir: 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_testing.sh /tmp/mountdir artifacts: paths: - "${LOG_PATH}"
test/bash_testing.sh 0 → 100755 +83 −0 Original line number Diff line number Diff line #!/bin/bash ROOT=${1} DIR=${ROOT}/nonexist_deep0 echo Removing a nonexist file rm -rvf ${DIR}/nonexist_deep1 retval=$? echo Remove non exising directory result : $retval if [ $retval -ne 0 ]; then exit 1 fi if [ -d $DIR/nonexist2_deep1 ]; then echo Nonexist2 exists -error- exit 1 fi mkdir -vp $DIR/nonexist2_deep1 retval=$? echo Creating directory nonexist_deep0/nonexist2_deep1 result : $retval if [ $retval -ne 0 ]; then exit 1 fi if [ -d $DIR/nonexist2_deep1 ]; then echo nonexist_deep0/nonexist2_deep1 exists -ok!- rm -vrf ${DIR}/nonexist2_deep1/* retval=$? echo Removing content inside nonexist2_deep1 result : $retval if [ $retval -ne 0 ]; then exit 1 fi rm -vrf ${DIR}/nonexist2_deep1 retval=$? echo Removing directory nonexist2_deep1 using rm : $retval if [ $retval -ne 0 ]; then exit 1 fi fi if [ -d $DIR/nonexist2_deep1 ]; then echo nonexist2_deep1 exist -error- exit 1 fi rmdir -v ${DIR}/nonexist_deep1 retval=$? echo rmdir result for a nonexisting directory, expect 1, result: $retval if [ $retval -ne 1 ]; then exit 1 fi if [ -d ${DIR}/nonexist_deep1 ]; then echo nonexist exist -error- exit 1 fi rm -vrf ${ROOT}/* retval=$? echo removing all contents of ${ROOT}, result: $retval if [ $retval -ne 0 ]; then exit 1 fi if [ -d ${DIR} ]; then echo directory not empty -error- exit 1 fi echo All ok! exit 0