aristanetworks / bst

A one-stop shop for process isolation
MIT License
101 stars 9 forks source link

unit test broken? #57

Open ani-sinha opened 3 years ago

ani-sinha commented 3 years ago
--- command ---
05:44:32 /home/anisinha/workspace/bst/test/cram.sh /home/anisinha/workspace/bst/test
--- stdout ---
diff --git a/home/anisinha/workspace/bst/test/net.t b/home/anisinha/workspace/bst/test/net.t.err
index ed61ab5..5338901 100755
--- a/home/anisinha/workspace/bst/test/net.t
+++ b/home/anisinha/workspace/bst/test/net.t.err
@@ -19,8 +19,8 @@ MACVLANs
 IPVLANs

    $ bst --nic parent,dummy,address=fe:ed:de:ad:be:ef bst --nic ipvlan,type=ipvlan,link=parent -- ip link show ipvlan
-   2: ipvlan@if2: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
-       link/ether fe:ed:de:ad:be:ef brd ff:ff:ff:ff:ff:ff link-netnsid 0
+   2: ipvlan: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
+       link/ether fe:ed:de:ad:be:ef brd ff:ff:ff:ff:ff:ff

 Adding addresses

@@ -29,7 +29,7 @@ Adding addresses
        link/ether fe:ed:de:ad:be:ef brd ff:ff:ff:ff:ff:ff
        inet 172.20.0.1/32 brd 172.20.0.1 scope global dummy
           valid_lft forever preferred_lft forever
-       inet6 fe80::fced:deff:fead:beef/64 scope link tentative 
+       inet6 fe80::fced:deff:fead:beef/64 scope link 
           valid_lft forever preferred_lft forever

    $ bst --nic dummy,type=dummy,address=fe:ed:de:ad:be:ef --ip 172.20.0.1/16,dev=dummy -- ip addr show dummy
@@ -37,7 +37,7 @@ Adding addresses
        link/ether fe:ed:de:ad:be:ef brd ff:ff:ff:ff:ff:ff
        inet 172.20.0.1/16 brd 172.20.255.255 scope global dummy
           valid_lft forever preferred_lft forever
-       inet6 fe80::fced:deff:fead:beef/64 scope link tentative 
+       inet6 fe80::fced:deff:fead:beef/64 scope link 
           valid_lft forever preferred_lft forever

 Adding routes
@@ -59,4 +59,4 @@ Adding routes
    default via 172.20.0.1 dev lo 

    $ bst --route dev=lo -- ip route show
-   default dev lo scope link 
+   default dev lo 
diff --git a/home/anisinha/workspace/bst/test/bst.t b/home/anisinha/workspace/bst/test/bst.t.err
index 230ba9d..d0e01cd 100755
--- a/home/anisinha/workspace/bst/test/bst.t
+++ b/home/anisinha/workspace/bst/test/bst.t.err
@@ -121,6 +121,8 @@ Testing hostname semantics
 Testing persistence

    $ mkdir -p foo bar; trap 'bst-unpersist foo && rmdir foo bar' EXIT; bst --persist=foo sh -c 'mount -t tmpfs none bar && echo hello > bar/greeting' && [ ! -f bar/greeting ] && bst --share mnt,user=foo sh -c '[ "$(cat '"$PWD"'/bar/greeting)" = "hello" ]'
+   bst: bind-mount /proc/1173705/ns/mnt to foo/mnt: Invalid argument (is the destination on a private mount?)
+   [1]

 Testing --limit core / general tests
    $ bst --limit core=0 test/print_limits core
-------
Snaipe commented 3 years ago

Some of these system tests are a bit machine-dependent, so the textual match can make them broken on some machines but not others.

A solution to the ip link output breakage would be to tell ip to output json, and then use jq to select the few fields that actually matter. Another would be to switch to python-cram (rather than the old cram.sh) and use regexp matching.

The second breakage is because your distro makes your rootfs & any submount have a shared propagation, which breaks --persist. A possible solution would be to wrap the test in another bst invocation.