/usr/share/cgmanager/tests/test14.sh is in cgmanager-tests 0.39-2ubuntu5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #!/bin/bash -x
kmaj=`awk -F. '{ print $1 '} /proc/sys/kernel/osrelease`
kmin=`awk -F. '{ print $2 '} /proc/sys/kernel/osrelease`
if [ $kmaj -eq 3 -a $kmin -eq 16 ]; then
echo "skipping test 14 (Remove)"
exit 0
fi
echo "Test 14 (Remove)"
cgm create memory xxx/bbb
cgm listchildren memory xxx | grep -q bbb
if [ $? -ne 0 ]; then
echo "Error durign setup: memory:xxx/b was not created"
exit 1
fi
# should fail - requires recursive delete
cgm remove memory xxx 0
if [ $? -eq 0 ]; then
echo "non-recursive Remove of non-empty directory wrongly succeeded."
exit 1
fi
cgm remove memory xxx
if [ $? -ne 0 ]; then
echo "recursive remove of directory wrongly failed."
echo "and here are the contents of memory:''"
cgm listchildren memory ''
echo "and here are the contents of memory:xxx"
cgm listchildren memory xxx
exit 1
fi
cgm create memory xxx/b
cgm remove memory xxx/bbb 0
if [ $? -ne 0 ]; then
echo "Failed to remove an empty directory (xxx/b)."
echo "and here are the contents of memory:''"
cgm listchildren memory ''
echo "and here are the contents of memory:xxx"
cgm listchildren memory xxx
exit 1
fi
exit 0
|