Define netmask for cobbler

This commit is contained in:
vic 2013-02-10 03:52:13 +04:00
parent b0cf09ded1
commit 42b204c488
3 changed files with 29 additions and 20 deletions

View File

@ -162,5 +162,8 @@ class CiBase(object):
def internal_network(self):
return str(IPNetwork(self.environment().network_by_name('internal').ip_network))
def internal_net_mask(self):
return str(IPNetwork(self.environment().network_by_name('internal').ip_network).netmask)
def public_network(self):
return str(IPNetwork(self.environment().network_by_name('public').ip_network))

View File

@ -144,6 +144,7 @@ class CobblerTestCase(BaseTestCase):
node_mac1="00:17:3e:{0:02x}:{1:02x}:02".format(i, j),
node_mac2="00:17:3e:{0:02x}:{1:02x}:03".format(i, j),
node_ip="192.168.{0:d}.{1:d}".format(i, j),
net_mask="255.255.0.0",
stomp_name=stomp_name,
gateway=self.ci().internal_router()
)
@ -155,7 +156,7 @@ class CobblerTestCase(BaseTestCase):
return "0"
def _add_node(self, client, token, cobbler, node_name, node_mac0, node_mac1,
node_mac2, node_ip, stomp_name, gateway):
node_mac2, node_ip, stomp_name, gateway, net_mask):
system_id = client.new_system(token)
if OS_FAMILY == 'centos':
profile = 'centos63_x86_64'
@ -177,6 +178,7 @@ class CobblerTestCase(BaseTestCase):
"static-eth0": self._static(node_name),
"macaddress-eth1": str(node_mac1),
"ipaddress-eth1": str(node_ip),
"netmask-eth1": str(net_mask),
"dnsname-eth1": node_name + ".your-domain-name.com",
"static-eth1": self._static(node_name),
"macaddress-eth2": str(node_mac2),
@ -185,7 +187,7 @@ class CobblerTestCase(BaseTestCase):
client.save_system(system_id, token)
client.sync(token)
def add_node(self, client, token, cobbler, node, gateway):
def add_node(self, client, token, cobbler, node, gateway, net_mask):
node_name = node.name
node_mac0 = str(node.interfaces[0].mac_address)
node_mac1 = str(node.interfaces[1].mac_address)
@ -195,7 +197,7 @@ class CobblerTestCase(BaseTestCase):
client, token, cobbler, node_name,
node_mac0, node_mac1, node_mac2, node_ip,
stomp_name=self.ci().nodes().stomps[0].name,
gateway=gateway
gateway=gateway, net_mask=net_mask,
)
def configure_cobbler(self):
@ -204,7 +206,11 @@ class CobblerTestCase(BaseTestCase):
cobbler.get_ip_address_by_network_name('internal'))
token = client.login('cobbler', 'cobbler')
for node in self.ci().client_nodes():
self.add_node(client, token, cobbler, node, gateway=self.ci().internal_router())
self.add_node(
client, token, cobbler, node,
gateway=self.ci().internal_router(),
net_mask=self.ci().internal_net_mask()
)
master = self.environment().node_by_name('master')
remote = master.remote('internal',
login='root',

View File

@ -1,6 +1,5 @@
import subprocess
from time import sleep
import unittest
from devops.helpers.helpers import ssh
import glanceclient
import keystoneclient.v2_0
@ -233,7 +232,8 @@ class Prepare():
'internal', login='root',
password='r00tme').sudo.ssh
self.tempest_mount_glance_images(remote, nfs_server)
sleep(60)
sleep(20)
if __name__ == '__main__':
unittest.main()
Prepare().prepare_tempest_folsom()