anchor.diff:            ''
               startAll;
   
  +            # Wait for networking to come up
               $client->waitForUnit("network-interfaces.target");
               $client->waitForUnit("network.target");
               $router->waitForUnit("network-interfaces.target");
               $router->waitForUnit("network.target");
   
               # Wait until we have an ip address on each interface
  -            $client->succeed("while ! ip addr show dev eth1 | grep '192.168.1'; do true; done");
  -            $client->succeed("while ! ip addr show dev macvlan | grep '192.168.1'; do true; done");
  -
  -            # Test macvlan
  -            $client->succeed("ping -c 1 192.168.1.1");
  -            $client->succeed("ping -c 1 192.168.1.2");
  -            $client->succeed("ping -c 1 192.168.1.3");
  -
  -            $router->succeed("ping -c 1 192.168.1.1");
  -            $router->succeed("ping -c 1 192.168.1.2");
  -            $router->succeed("ping -c 1 192.168.1.3");
  +            $client->waitUntilSucceeds("ip addr show dev eth1 | grep -q '192.168.1'");
  +            $client->waitUntilSucceeds("ip addr show dev macvlan | grep -q '192.168.1'");
  +
  +            # Print diagnosting information
  +            $router->succeed("ip addr >&2");
  +            $client->succeed("ip addr >&2");
  +
  +            # Test macvlan creates routable ips
  +            $client->waitUntilSucceeds("ping -c 1 192.168.1.1");
  +            $client->waitUntilSucceeds("ping -c 1 192.168.1.2");
  +            $client->waitUntilSucceeds("ping -c 1 192.168.1.3");
  +
  +            $router->waitUntilSucceeds("ping -c 1 192.168.1.1");
  +            $router->waitUntilSucceeds("ping -c 1 192.168.1.2");
  +            $router->waitUntilSucceeds("ping -c 1 192.168.1.3");
             '';
         };
         sit = let
  
positive.code:             $client->fail("systemctl status dhcpcd.service");
  
              # Test vlan 1
              $client->succeed("ping -c 1 192.168.1.1");
              $client->succeed("ping -c 1 192.168.1.2");
              $client->succeed("ping -c 1 192.168.1.3");
              $client->succeed("ping -c 1 192.168.1.10");
  
              $router->succeed("ping -c 1 192.168.1.1");
              $router->succeed("ping -c 1 192.168.1.2");
              $router->succeed("ping -c 1 192.168.1.3");
              $router->succeed("ping -c 1 192.168.1.10");
  
              # Test vlan 2
              $client->succeed("ping -c 1 192.168.2.1");
              $client->succeed("ping -c 1 192.168.2.2");
  
              $router->succeed("ping -c 1 192.168.2.1");
              $router->succeed("ping -c 1 192.168.2.2");
  
              # Test default gateway
              $router->succeed("ping -c 1 192.168.3.1");
              $client->succeed("ping -c 1 192.168.3.1");
            '';
        };
        dhcpSimple = {
  
negative.code:           ''
              startAll;
  
              # Wait for networking to come up
              $client->waitForUnit("network-interfaces.target");
              $client->waitForUnit("network.target");
              $router->waitForUnit("network-interfaces.target");
              $router->waitForUnit("network.target");
  
              # Wait until we have an ip address on each interface
              $client->waitUntilSucceeds("ip addr show dev eth1 | grep -q '192.168.1'");
  
              # Test vlan 1
              $client->waitUntilSucceeds("ping -c 1 192.168.1.1");
              $client->waitUntilSucceeds("ping -c 1 192.168.1.2");
  
              $router->waitUntilSucceeds("ping -c 1 192.168.1.1");
              $router->waitUntilSucceeds("ping -c 1 192.168.1.2");
  
              # Test vlan 2
              $client->waitUntilSucceeds("ping -c 1 192.168.2.1");
              $client->fail("ping -c 1 192.168.2.2");
  
              $router->waitUntilSucceeds("ping -c 1 192.168.2.1");
              $router->fail("ping -c 1 192.168.2.2");
            '';
        };
  