]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: Fix lxc-user-nic path
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 17:51:01 +0000 (12:51 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 19:25:15 +0000 (14:25 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
configure.ac
src/tests/lxc-test-usernic.in [moved from src/tests/lxc-test-usernic with 88% similarity]

index 6bfe96bfd2d08a516e5d178ff7e5289e7fb9471d..8914f81766781f359a0bb91a9b0d6f7ccb8476e7 100644 (file)
@@ -696,6 +696,7 @@ AC_CONFIG_FILES([
        src/lua-lxc/Makefile
 
        src/tests/Makefile
+       src/tests/lxc-test-usernic
 ])
 AC_CONFIG_COMMANDS([default],[[]],[[]])
 AC_OUTPUT
similarity index 88%
rename from src/tests/lxc-test-usernic
rename to src/tests/lxc-test-usernic.in
index d00b223b3bfc30cbb9469d16211e7f17c422c83c..eb0f30e5e4d4c67743eed2401543fb11097e3808 100755 (executable)
@@ -22,6 +22,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 DONE=0
+LXC_USER_NIC="@LIBEXECDIR@/lxc/lxc-user-nic"
 
 cleanup() {
        (
@@ -95,7 +96,7 @@ run_cmd "lxc-start -n b1 -d"
 p1=$(run_cmd "lxc-info -n b1 -p -H")
 
 # 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 $p1 veth usernic-br0 xx1"; then
        echo "FAIL: able to create nic with no entries"
        exit 1
 fi
@@ -106,24 +107,24 @@ sed -i '/^usernic-user/d' /etc/lxc/lxc-usernet
 echo "usernic-user veth usernic-br0 2" >> /etc/lxc/lxc-usernet
 
 # 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 $p1 veth usernic-br1 xx1"; then
        echo "FAIL: able to create nic with no entries"
        exit 1
 fi
 
 # Assign two veths, should succeed
-if ! run_cmd "lxc-user-nic $p1 veth usernic-br0 xx2"; then
+if ! run_cmd "$LXC_USER_NIC $p1 veth usernic-br0 xx2"; then
        echo "FAIL: unable to create first nic"
        exit 1
 fi
 
-if ! run_cmd "lxc-user-nic $p1 veth usernic-br0 xx3"; then
+if ! run_cmd "$LXC_USER_NIC $p1 veth usernic-br0 xx3"; then
        echo "FAIL: unable to create second nic"
        exit 1
 fi
 
 # Assign one more veth, should fail.
-if run_cmd "lxc-user-nic $p1 veth usernic-br0 xx4"; then
+if run_cmd "$LXC_USER_NIC $p1 veth usernic-br0 xx4"; then
        echo "FAIL: able to create third nic"
        exit 1
 fi
@@ -133,7 +134,7 @@ run_cmd "lxc-stop -n b1 -k"
 run_cmd "lxc-start -n b1 -d"
 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 $p1 veth usernic-br0 xx5"; then
        echo "FAIL: unable to create nic after destroying the old"
        cleanup 1
 fi
@@ -146,7 +147,7 @@ lxc-start -n usernic-c1 -d
 p2=$(lxc-info -n usernic-c1 -p -H)
 
 # assign veth to it - should fail
-if run_cmd "lxc-user-nic $p2 veth usernic-br0 xx6"; then
+if run_cmd "$LXC_USER_NIC $p2 veth usernic-br0 xx6"; then
        echo "FAIL: able to attach nic to root-owned container"
        cleanup 1
 fi