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
615af4ac
Commit
615af4ac
authored
Jan 28, 2016
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-test-usernic: update to reflect new lxc-test-usernic arguments
the new lxcpath and lxcname are not optional Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
6361a0f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
lxc-test-usernic.in
src/tests/lxc-test-usernic.in
+10
-7
No files found.
src/tests/lxc-test-usernic.in
View file @
615af4ac
...
@@ -136,8 +136,11 @@ run_cmd "lxc-create -t download -n b1 -- -d ubuntu -r trusty -a $ARCH"
...
@@ -136,8 +136,11 @@ run_cmd "lxc-create -t download -n b1 -- -d ubuntu -r trusty -a $ARCH"
run_cmd
"lxc-start -n b1 -d"
run_cmd
"lxc-start -n b1 -d"
p1
=
$(
run_cmd
"lxc-info -n b1 -p -H"
)
p1
=
$(
run_cmd
"lxc-info -n b1 -p -H"
)
lxcpath
=
/home/usernic-user/.local/share/lxc
lxcname
=
b1
# Assign one veth, should fail as no allowed entries yet
# Assign one veth, should fail as no allowed entries yet
if
run_cmd
"
$LXC_USER_NIC
$p1
veth usernic-br0 xx1"
;
then
if
run_cmd
"
$LXC_USER_NIC
$
lxcpath
$lxcname
$
p1
veth usernic-br0 xx1"
;
then
echo
"FAIL: able to create nic with no entries"
echo
"FAIL: able to create nic with no entries"
exit
1
exit
1
fi
fi
...
@@ -148,24 +151,24 @@ sed -i '/^usernic-user/d' /etc/lxc/lxc-usernet
...
@@ -148,24 +151,24 @@ sed -i '/^usernic-user/d' /etc/lxc/lxc-usernet
echo
"usernic-user veth usernic-br0 2"
>>
/etc/lxc/lxc-usernet
echo
"usernic-user veth usernic-br0 2"
>>
/etc/lxc/lxc-usernet
# Assign one veth to second bridge, should fail
# Assign one veth to second bridge, should fail
if
run_cmd
"
$LXC_USER_NIC
$p1
veth usernic-br1 xx1"
;
then
if
run_cmd
"
$LXC_USER_NIC
$
lxcpath
$lxcname
$
p1
veth usernic-br1 xx1"
;
then
echo
"FAIL: able to create nic with no entries"
echo
"FAIL: able to create nic with no entries"
exit
1
exit
1
fi
fi
# Assign two veths, should succeed
# Assign two veths, should succeed
if
!
run_cmd
"
$LXC_USER_NIC
$p1
veth usernic-br0 xx2"
;
then
if
!
run_cmd
"
$LXC_USER_NIC
$
lxcpath
$lxcname
$
p1
veth usernic-br0 xx2"
;
then
echo
"FAIL: unable to create first nic"
echo
"FAIL: unable to create first nic"
exit
1
exit
1
fi
fi
if
!
run_cmd
"
$LXC_USER_NIC
$p1
veth usernic-br0 xx3"
;
then
if
!
run_cmd
"
$LXC_USER_NIC
$
lxcpath
$lxcname
$
p1
veth usernic-br0 xx3"
;
then
echo
"FAIL: unable to create second nic"
echo
"FAIL: unable to create second nic"
exit
1
exit
1
fi
fi
# Assign one more veth, should fail.
# Assign one more veth, should fail.
if
run_cmd
"
$LXC_USER_NIC
$p1
veth usernic-br0 xx4"
;
then
if
run_cmd
"
$LXC_USER_NIC
$
lxcpath
$lxcname
$
p1
veth usernic-br0 xx4"
;
then
echo
"FAIL: able to create third nic"
echo
"FAIL: able to create third nic"
exit
1
exit
1
fi
fi
...
@@ -175,7 +178,7 @@ run_cmd "lxc-stop -n b1 -k"
...
@@ -175,7 +178,7 @@ run_cmd "lxc-stop -n b1 -k"
run_cmd
"lxc-start -n b1 -d"
run_cmd
"lxc-start -n b1 -d"
p1
=
$(
run_cmd
"lxc-info -n b1 -p -H"
)
p1
=
$(
run_cmd
"lxc-info -n b1 -p -H"
)
if
!
run_cmd
"
$LXC_USER_NIC
$p1
veth usernic-br0 xx5"
;
then
if
!
run_cmd
"
$LXC_USER_NIC
$
lxcpath
$lxcname
$
p1
veth usernic-br0 xx5"
;
then
echo
"FAIL: unable to create nic after destroying the old"
echo
"FAIL: unable to create nic after destroying the old"
cleanup 1
cleanup 1
fi
fi
...
@@ -188,7 +191,7 @@ lxc-start -n usernic-c1 -d
...
@@ -188,7 +191,7 @@ lxc-start -n usernic-c1 -d
p2
=
$(
lxc-info
-n
usernic-c1
-p
-H
)
p2
=
$(
lxc-info
-n
usernic-c1
-p
-H
)
# assign veth to it - should fail
# assign veth to it - should fail
if
run_cmd
"
$LXC_USER_NIC
$p2
veth usernic-br0 xx6"
;
then
if
run_cmd
"
$LXC_USER_NIC
$
lxcpath
$lxcname
$
p2
veth usernic-br0 xx6"
;
then
echo
"FAIL: able to attach nic to root-owned container"
echo
"FAIL: able to attach nic to root-owned container"
cleanup 1
cleanup 1
fi
fi
...
...
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