Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
cb9b4e09
Unverified
Commit
cb9b4e09
authored
Jul 18, 2017
by
Li Feng
Committed by
Stéphane Graber
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test script to test the ro option of lxc.rootfs.options
Signed-off-by:
Li Feng
<
lifeng68@huawei.com
>
parent
d21aa4fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
2 deletions
+72
-2
Makefile.am
src/tests/Makefile.am
+6
-2
lxc-test-rootfs
src/tests/lxc-test-rootfs
+66
-0
No files found.
src/tests/Makefile.am
View file @
cb9b4e09
...
...
@@ -57,8 +57,11 @@ bin_PROGRAMS = lxc-test-containertests lxc-test-locktests lxc-test-startone \
lxc-test-apparmor lxc-test-utils lxc-test-parse-config-file
\
lxc-test-config-jump-table lxc-test-shortlived
bin_SCRIPTS
=
lxc-test-automount lxc-test-autostart lxc-test-cloneconfig
\
lxc-test-createconfig
bin_SCRIPTS
=
lxc-test-automount
\
lxc-test-autostart
\
lxc-test-cloneconfig
\
lxc-test-createconfig
lxc-test-rootfs
if
DISTRO_UBUNTU
bin_SCRIPTS
+=
\
...
...
@@ -91,6 +94,7 @@ EXTRA_DIST = \
lxcpath.c
\
lxc-test-lxc-attach
\
lxc-test-automount
\
lxc-test-rootfs
\
lxc-test-autostart
\
lxc-test-apparmor-mount
\
lxc-test-checkpoint-restore
\
...
...
src/tests/lxc-test-rootfs
0 → 100755
View file @
cb9b4e09
#!/bin/bash
# lxc: linux Container library
# Authors:
# Feng Li <lifeng68@huawei.com>
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
set
-ex
cleanup
()
{
set
+e
lxc-destroy
-n
lxc-test-rootfs
-f
if
[
$PHASE
!=
"done"
]
;
then
echo
"rootfs test failed at
$PHASE
"
exit
1
fi
echo
"rootfs test passed"
exit
0
}
PHASE
=
setup
trap
cleanup EXIT
lxc-destroy
-n
lxc-test-rootfs
-f
||
true
lxc-create
-t
busybox
-n
lxc-test-rootfs
PHASE
=
ro_rootfs
echo
"Starting phase
$PHASE
"
config
=
/var/lib/lxc/lxc-test-rootfs/config
sed
-i
'/lxc.rootfs.options/d'
$config
echo
"lxc.rootfs.options = ro"
>>
$config
lxc-start
-n
lxc-test-rootfs
pid
=
`
lxc-info
-n
lxc-test-rootfs
-p
-H
`
ro
=
0
mkdir
/proc/
$pid
/root/rotest
||
ro
=
1
[
$ro
-ne
0
]
lxc-stop
-n
lxc-test-rootfs
-k
PHASE
=
rw_rootfs
echo
"Starting phase
$PHASE
"
sed
-i
'/lxc.rootfs.options/d'
$config
echo
"lxc.rootfs.options = rw"
>>
$config
lxc-start
-n
lxc-test-rootfs
pid
=
`
lxc-info
-n
lxc-test-rootfs
-p
-H
`
ro
=
0
mkdir
/proc/
$pid
/root/rwtest
||
ro
=
1
[
$ro
-ne
1
]
rmdir
/proc/
$pid
/root/rwtest
ro
=
0
PHASE
=
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment