network_from_url_test.go 812 B

123456789101112131415161718192021222324252627282930313233343536
  1. package integration
  2. import . "gopkg.in/check.v1"
  3. func (s *QemuSuite) TestNetworkFromUrl(c *C) {
  4. netArgs := []string{"-net", "nic,vlan=0,model=virtio"}
  5. args := []string{"--cloud-config", "./tests/assets/test_10/cloud-config.yml"}
  6. for i := 0; i < 7; i++ {
  7. args = append(args, netArgs...)
  8. }
  9. err := s.RunQemu(args...)
  10. c.Assert(err, IsNil)
  11. s.CheckCall(c, `
  12. cat > test-merge << "SCRIPT"
  13. set -x -e
  14. ip link show dev br0
  15. ip link show dev br0.100 | grep br0.100@br0
  16. ip link show dev eth1.100 | grep 'master br0'
  17. SCRIPT
  18. sudo bash test-merge`)
  19. s.CheckCall(c, `
  20. cat > test-merge << "SCRIPT"
  21. set -x -e
  22. cat /etc/resolv.conf | grep "search mydomain.com example.com"
  23. cat /etc/resolv.conf | grep "nameserver 208.67.222.123"
  24. cat /etc/resolv.conf | grep "nameserver 208.67.220.123"
  25. SCRIPT
  26. sudo bash test-merge`)
  27. }