forked from canonical/chisel-releases
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: change tests to not require a priveliged container
- Loading branch information
1 parent
94b1c95
commit ce546ec
Showing
3 changed files
with
15 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# Run a smoke test for mount and umount to verify that | ||
# they are doing what we expect by testing on /proc | ||
# simple smoke test that it loads | ||
mount --help | ||
|
||
cat > /etc/fstab <<EOF | ||
# test on a chrooted env, but let us make sure it exists | ||
EOF | ||
|
||
# Do not do the actually mounting syscall as that will | ||
# be blocked inside the docker container. We do dry-runs | ||
# instead to ensure that the rest of the binary looks ok | ||
mkdir /test-bin | ||
mount --bind /bin /test-bin | ||
count=$(ls /test-bin | wc -l) | ||
umount /test-bin | ||
|
||
if [ $count -eq 0 ] | ||
then | ||
echo "no files in /test-bin, did mount not work?" | ||
exit 1 | ||
fi | ||
mount --fake --bind /bin /test-bin | ||
|
||
# we cannot test the 'mount -l' without mounting /proc | ||
# as it is a symlink from /etc/mtab to ../proc/self/mounts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters