1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Add a failing test for dualnics with static ip missing

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-06-13 19:33:27 +10:00
parent 034073b8ab
commit 3978d93fca
9 changed files with 319 additions and 15 deletions

View File

@@ -159,3 +159,112 @@ sync
s.Stop(c)
}
func (s *QemuSuite) KillsMyServerTestInstalledDhcp(c *C) {
// ./scripts/run --no-format --append "rancher.debug=true" --iso --fresh
runArgs := []string{
"--iso",
"--fresh",
// "-net", "nic,vlan=0,model=virtio",
// "-net", "user,vlan=0",
// "-net", "nic,vlan=0,model=virtio",
// "-net", "user,vlan=0",
}
version := ""
{
s.RunQemuWith(c, runArgs...)
s.MakeCall("ip a")
version = s.CheckOutput(c, version, Not(Equals), "sudo ros -v")
fmt.Printf("installing %s", version)
s.CheckCall(c, `
echo "ssh_authorized_keys:" > config.yml
echo " - $(cat /home/rancher/.ssh/authorized_keys)" >> config.yml
echo "rancher:" >> config.yml
echo " network:" >> config.yml
echo " interfaces:" >> config.yml
echo " eth2:" >> config.yml
echo " dhcp: true" >> config.yml
echo " eth1:" >> config.yml
echo " address: 10.0.2.253/24" >> config.yml
echo " dhcp: false" >> config.yml
echo " gateway: 10.0.2.1" >> config.yml
echo " mtu: 1500" >> config.yml
ip a
echo "==================="
cat config.yml | sudo ros config merge
sudo ros service stop network
sleep 1
sudo ros service start network
sleep 1
ip a
echo "==================="
sudo ros install --force --no-reboot --device /dev/vda -c config.yml -a "console=ttyS0 rancher.console=ttyS0 rancher.autologin=ttyS0 rancher.console=ttyS1 rancher.autologin=ttyS1 rancher.debug=true"
sync
`)
time.Sleep(500 * time.Millisecond)
s.Stop(c)
}
runArgs = []string{
"--boothd",
"-net", "nic,vlan=0,model=virtio",
"-net", "user,vlan=0",
"-net", "nic,vlan=0,model=virtio",
"-net", "user,vlan=0",
}
s.RunQemuWithNetConsole(c, runArgs...)
s.NetCheckOutput(c, version, Equals, "sudo ros -v")
s.NetCheckOutput(c, "", Not(Equals), "sh", "-c", "ip a show eth1 | grep 10.0.2..253")
s.Stop(c)
}
func (s *QemuSuite) TestConfigDhcp(c *C) {
runArgs := []string{
"--iso",
"--fresh",
"-net", "nic,vlan=0,model=virtio",
"-net", "user,vlan=0",
"-net", "nic,vlan=0,model=virtio",
"-net", "user,vlan=0",
}
version := ""
{
s.RunQemuWithNetConsole(c, runArgs...)
s.NetCall("ip a")
version = s.NetCheckOutput(c, version, Not(Equals), "sudo ros -v")
fmt.Printf("installing %s", version)
s.NetCheckCall(c, `
echo "ssh_authorized_keys:" > config.yml
echo " - $(cat /home/rancher/.ssh/authorized_keys)" >> config.yml
echo "rancher:" >> config.yml
echo " network:" >> config.yml
echo " interfaces:" >> config.yml
echo " eth2:" >> config.yml
echo " dhcp: true" >> config.yml
echo " eth1:" >> config.yml
echo " address: 10.0.2.253/24" >> config.yml
echo " dhcp: false" >> config.yml
echo " gateway: 10.0.2.1" >> config.yml
echo " mtu: 1500" >> config.yml
ip a
echo "==================="
cat config.yml | sudo ros config merge
sudo ros service stop network
sleep 1
sudo ros service start network
sleep 1
ip a
`)
s.NetCheckOutput(c, version, Equals, "sudo ros -v")
s.NetCheckOutput(c, "", Not(Equals), "sh", "-c", "ip a show eth1 2>/dev/null | grep 10.0.2.253")
s.Stop(c)
}
}