Skip to content

Commit

Permalink
enable --verbose + add step to collect test env info
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Feb 10, 2023
1 parent a11f1c0 commit 7e47023
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/test_eessi_container_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
run: |
./install_apptainer_ubuntu.sh
- name: Collect info on test environment
run: |
mount
df -h
- name: Test eessi_container.sh script
run: |
test_cmd="cat /etc/os-release"
Expand All @@ -39,21 +44,21 @@ jobs:
echo "${test_cmd}" > test_script.sh
chmod u+x test_script.sh
export SINGULARITY_BIND="$PWD:/test"
./eessi_container.sh --mode run /test/test_script.sh | tee ${outfile}
./eessi_container.sh --verbose --mode run /test/test_script.sh | tee ${outfile}
grep "${out_pattern}" ${outfile}
# test use of --mode shell
elif [[ ${{matrix.SCRIPT_TEST}} == 'shell' ]]; then
outfile=out_shell.txt
./eessi_container.sh --mode shell <<< "${test_cmd}" 2>&1 | tee ${outfile}
./eessi_container.sh --verbose --mode shell <<< "${test_cmd}" 2>&1 | tee ${outfile}
grep "${out_pattern}" ${outfile}
# test use of --container option, using a totally different container;
# cfr. https://github.com/easybuilders/easybuild-containers
elif [[ ${{matrix.SCRIPT_TEST}} == 'container' ]]; then
outfile=out_container.txt
container="docker://ghcr.io/eessi/build-node:debian10"
./eessi_container.sh --container ${container} --mode shell <<< "${test_cmd}" 2>&1 | tee ${outfile}
./eessi_container.sh --verbose --container ${container} --mode shell <<< "${test_cmd}" 2>&1 | tee ${outfile}
grep "Debian GNU/Linux 10" ${outfile}
# test use of '--access rw' to get write access in container
Expand All @@ -63,22 +68,22 @@ jobs:
echo "touch /cvmfs/pilot.eessi-hpc.org/${fn}" > test_script.sh
chmod u+x test_script.sh
export SINGULARITY_BIND="$PWD:/test"
./eessi_container.sh --access rw --mode run /test/test_script.sh > ${outfile}
./eessi_container.sh --verbose --access rw --mode run /test/test_script.sh > ${outfile}
tmpdir=$(grep "\-\-resume" ${outfile} | sed "s/.*--resume \([^']*\).*/\1/g")
# note: must use '--access rw' again here, since touched file is in overlay upper dir
./eessi_container.sh --resume ${tmpdir} --access rw --mode shell <<< "ls -l /cvmfs/pilot.eessi-hpc.org/${fn}" > ${outfile}
./eessi_container.sh --verbose --resume ${tmpdir} --access rw --mode shell <<< "ls -l /cvmfs/pilot.eessi-hpc.org/${fn}" > ${outfile}
grep "/cvmfs/pilot.eessi-hpc.org/${fn}$" $outfile
# test use of --resume
elif [[ ${{matrix.SCRIPT_TEST}} == 'resume' ]]; then
outfile=out_resume.txt
./eessi_container.sh --mode shell <<< "${test_cmd}" > ${outfile}
./eessi_container.sh --verbose --mode shell <<< "${test_cmd}" > ${outfile}
tmpdir=$(grep "\-\-resume" ${outfile} | sed "s/.*--resume \([^']*\).*/\1/g")
rm -f ${outfile}
./eessi_container.sh --resume ${tmpdir} --mode shell <<< "${test_cmd}" > ${outfile}
./eessi_container.sh --verbose --resume ${tmpdir} --mode shell <<< "${test_cmd}" > ${outfile}
cat ${outfile}
grep "Resuming from previous run using temporary storage at ${tmpdir}" ${outfile}
grep "${out_pattern}" ${outfile}
Expand All @@ -88,10 +93,10 @@ jobs:
outfile=out_save.txt
fn="test_${RANDOM}.txt"
test_cmd="touch /cvmfs/pilot.eessi-hpc.org/${fn}"
./eessi_container.sh --mode shell --access rw --save test-save.tar <<< "${test_cmd}" 2>&1 | tee ${outfile}
./eessi_container.sh --verbose --mode shell --access rw --save test-save.tar <<< "${test_cmd}" 2>&1 | tee ${outfile}
rm -f ${outfile}
./eessi_container.sh --mode shell --access rw --resume test-save.tar <<< "ls -l /cvmfs/pilot.eessi-hpc.org/${fn}" > ${outfile}
./eessi_container.sh --verbose --mode shell --access rw --resume test-save.tar <<< "ls -l /cvmfs/pilot.eessi-hpc.org/${fn}" > ${outfile}
grep "/cvmfs/pilot.eessi-hpc.org/${fn}$" $outfile
tar tfv test-save.tar | grep "overlay-upper/${fn}"
Expand Down

0 comments on commit 7e47023

Please sign in to comment.