Skip to content

Instantly share code, notes, and snippets.

@ibobcode
Last active July 22, 2019 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibobcode/176fd3645ece55054a3c6f9ce861d533 to your computer and use it in GitHub Desktop.
Save ibobcode/176fd3645ece55054a3c6f9ce861d533 to your computer and use it in GitHub Desktop.
#!/bin/bash
is_mounted_test() {
if test -d "/fs"; then
printf "> Mounted fs : \t OK\n"
else
printf "> Mounted fs : \t KO\n"
fi
}
file_creation_test() {
if touch "/fs/testfile"; then
printf "> Created file : \t OK\n"
else
printf "> Created file : \t KO\n"
fi
}
compress_directory_test() {
if tar -cf ./results.tar -C / fs; then
printf "> Created tarball : \t OK\n"
else
printf "> Created tarball : \t KO\n"
fi
}
echo "---------- START TESTS ---------"
printf "\n"
sleep 1
printf "> Curled source file : \t OK\n"
sleep 1
is_mounted_test
sleep 1
file_creation_test
sleep 1
compress_directory_test
sleep 1
printf "\n"
echo "----------- END TESTS ----------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment