]>
git.proxmox.com Git - mirror_lxc.git/blob - src/tests/lxc-test-rootfs
3 # lxc: linux Container library
6 # Feng Li <lifeng68@huawei.com>
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License, or (at your option) any later version.
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 lxc-destroy
-n lxc-test-rootfs
-f
27 if [ $PHASE != "done" ]; then
28 echo "rootfs test failed at $PHASE"
31 echo "rootfs test passed"
38 lxc-destroy
-n lxc-test-rootfs
-f || true
39 lxc-create
-t busybox
-n lxc-test-rootfs
42 echo "Starting phase $PHASE"
43 config
=/var
/lib
/lxc
/lxc-test-rootfs
/config
44 sed -i '/lxc.rootfs.options/d' $config
45 echo "lxc.rootfs.options = ro" >> $config
47 lxc-start
-n lxc-test-rootfs
48 pid
=`lxc-info -n lxc-test-rootfs -p -H`
50 mkdir
/proc
/$pid/root
/rotest || ro
=1
53 lxc-stop
-n lxc-test-rootfs
-k
55 echo "Starting phase $PHASE"
56 sed -i '/lxc.rootfs.options/d' $config
57 echo "lxc.rootfs.options = rw" >> $config
58 lxc-start
-n lxc-test-rootfs
59 pid
=`lxc-info -n lxc-test-rootfs -p -H`
61 mkdir
/proc
/$pid/root
/rwtest || ro
=1
63 rmdir /proc
/$pid/root
/rwtest