network_test.go 931 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. s.RunQemu(c, args...)
  10. s.CheckCall(c, `
  11. cat > test-merge << "SCRIPT"
  12. set -x -e
  13. ip link show dev br0
  14. ip link show dev br0.100 | grep br0.100@br0
  15. ip link show dev eth1.100 | grep 'master br0'
  16. ip link show dev eth6 | grep 'master bond0'
  17. ip link show dev eth7 | grep 'master bond0'
  18. [ "$(</sys/class/net/bond0/bonding/mode)" = "active-backup 1" ]
  19. SCRIPT
  20. sudo bash test-merge`)
  21. s.CheckCall(c, `
  22. cat > test-merge << "SCRIPT"
  23. set -x -e
  24. cat /etc/resolv.conf | grep "search mydomain.com example.com"
  25. cat /etc/resolv.conf | grep "nameserver 208.67.222.123"
  26. cat /etc/resolv.conf | grep "nameserver 208.67.220.123"
  27. SCRIPT
  28. sudo bash test-merge`)
  29. }