network_test.go 957 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package integration
  2. import . "gopkg.in/check.v1"
  3. func (s *QemuSuite) TestNetwork(c *C) {
  4. netArgs := []string{"-net", "nic,vlan=0,model=virtio"}
  5. args := []string{"--cloud-config", "./tests/assets/test_09/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. ip link show dev eth6 | grep 'master bond0'
  18. ip link show dev eth7 | grep 'master bond0'
  19. [ "$(</sys/class/net/bond0/bonding/mode)" = "active-backup 1" ]
  20. SCRIPT
  21. sudo bash test-merge`)
  22. s.CheckCall(c, `
  23. cat > test-merge << "SCRIPT"
  24. set -x -e
  25. cat /etc/resolv.conf | grep "search mydomain.com example.com"
  26. cat /etc/resolv.conf | grep "nameserver 208.67.222.123"
  27. cat /etc/resolv.conf | grep "nameserver 208.67.220.123"
  28. SCRIPT
  29. sudo bash test-merge`)
  30. }