Commit 11414807 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Fix example IPs and hostnames in tests



Our tests are a form of documentation, and hence should use
IPs from the TEST-NET ranges according to RFC 5737. They definitely
should not use real public IP addresses.

Similarly, example host names should be from one of the reserved
domains according to RFC 2606.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 0d8ce33e
......@@ -262,7 +262,7 @@ class TestLUClusterRedistConf(CmdlibTestCase):
class TestLUClusterRename(CmdlibTestCase):
NEW_NAME = "new-name.example.com"
NEW_IP = "1.2.3.4"
NEW_IP = "203.0.113.1"
def testNoChanges(self):
op = opcodes.OpClusterRename(name=self.cfg.GetClusterName())
......
......@@ -159,7 +159,7 @@ class TestLUInstanceCreate(CmdlibTestCase):
def testStrangeHostnameResolve(self):
op = self.CopyOpCode(self.diskless_op)
self.netutils_mod.GetHostname.return_value = \
HostnameMock("random.host.com", "1.2.3.4")
HostnameMock("random.host.example.com", "203.0.113.1")
self.ExecOpCodeExpectOpPrereqError(
op, "Resolved hostname .* does not look the same as given hostname")
......@@ -217,7 +217,7 @@ class TestLUInstanceCreate(CmdlibTestCase):
def testValidIp(self):
op = self.CopyOpCode(self.diskless_op,
nics=[{
constants.INIC_IP: "1.2.3.4"
constants.INIC_IP: "203.0.113.1"
}])
self.ExecOpCode(op)
......@@ -299,7 +299,7 @@ class TestLUInstanceCreate(CmdlibTestCase):
def testIpNotInNetwork(self):
op = self.CopyOpCode(self.diskless_op,
nics=[{
constants.INIC_IP: "1.2.3.4",
constants.INIC_IP: "203.0.113.1",
constants.INIC_NETWORK: self.net.name
}])
self.ExecOpCodeExpectOpPrereqError(
......@@ -708,7 +708,7 @@ disk1_dump=mock_path
nic0_mode=bridged
nic0_link=br_mock
nic0_mac=f6:ab:f4:45:d1:af
nic0_ip=123.123.123.1
nic0_ip=198.51.100.1
tags=tag1 tag2
hypervisor=xen-hvm
[hypervisor]
......
......@@ -72,7 +72,7 @@ def _GetHostnameMock(cfg, mock_fct, name=None, family=None):
if node is not None:
return HostnameMock(node.name, node.primary_ip)
return HostnameMock(name, "1.2.3.4")
return HostnameMock(name, "203.0.113.1")
# pylint: disable=W0613
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment