-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to check the akt mount command
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
|
||
if test $# -ne 1; then | ||
echo "Usage: check-mount.sh {START|FILL|CLEAN|CHECK}" | ||
exit 2 | ||
fi | ||
|
||
function umount_akt () { | ||
umount regtests/result/mount 2>/dev/null | ||
} | ||
|
||
case $1 in | ||
START) | ||
rm -rf regtests/result/mount | ||
mkdir -p regtests/result/mount && | ||
bin/akt create regtests/result/test-mount.akt --password=mount -c 100:1000 -f && | ||
echo "PASS" | ||
res=$? | ||
;; | ||
|
||
FILL) | ||
trap umount_akt 0 | ||
bin/akt mount --password=mount regtests/result/test-mount.akt regtests/result/mount && | ||
sleep 1 && | ||
cp -r obj regtests/result/mount && | ||
diff -rup obj regtests/result/mount/obj && | ||
cp -r src regtests/result/mount && | ||
diff -rup src regtests/result/mount/src && | ||
echo "PASS" | ||
res=$? | ||
;; | ||
|
||
CLEAN) | ||
trap umount_akt 0 | ||
bin/akt mount -f --password=mount regtests/result/test-mount.akt regtests/result/mount & | ||
sleep 1 | ||
rm -rf regtests/result/mount/obj && | ||
rm -rf regtests/result/mount/src && | ||
cp configure LICENSE.txt regtests/result/mount/ && | ||
diff -rup LICENSE.txt regtests/result/mount/ && | ||
echo "PASS" | ||
res=$? | ||
;; | ||
|
||
MIX) | ||
trap umount_akt 0 | ||
bin/akt mount -f --password=mount regtests/result/test-mount.akt regtests/result/mount & | ||
sleep 1 | ||
for i in 1 2 3 4 5; do | ||
rm -rf regtests/result/mount/bin && | ||
cp -r bin regtests/result/mount/bin && | ||
diff -r bin regtests/result/mount/bin && | ||
rm -rf regtests/result/mount/obj && | ||
cp -r obj regtests/result/mount/obj && | ||
diff -r obj regtests/result/mount/obj && | ||
cp configure LICENSE.txt regtests/result/mount/ && | ||
diff -rup LICENSE.txt regtests/result/mount/ | ||
done | ||
echo "PASS" | ||
res=$? | ||
;; | ||
|
||
CHECK) | ||
bin/akt list --password=mount regtests/result/test-mount.akt > /dev/null && | ||
bin/akt get -n --password=mount regtests/result/test-mount.akt LICENSE.txt > regtests/result/LICENSE.txt && | ||
cmp LICENSE.txt regtests/result/LICENSE.txt | ||
echo "PASS" | ||
res=$? | ||
;; | ||
|
||
*) | ||
exit 1; | ||
;; | ||
esac | ||
|
||
exit $res |