[cooks] [test] Add network cookbook and test for it; delete metadata.json.

This commit is contained in:
Andrey Danin 2012-08-14 12:51:29 +04:00
parent eacb06ce13
commit ff1491aeee
2 changed files with 30 additions and 1 deletions

2
cooks

@ -1 +1 @@
Subproject commit a96a1fdddbed149086e25771b550b0eacc5d5bb5
Subproject commit 87f0dbc2a77632230ae6c1ad506464a8cbd69af2

View File

@ -0,0 +1,29 @@
from . import CookbookTestCase
from devops.helpers import tcp_ping
class TestNetworkCreateInterfaces(CookbookTestCase):
cookbooks = ['network']
@classmethod
def setUpState(klass):
klass.chef_solo({
'recipes': ['network::create_interfaces'],
'networks': {
'first': {'device': 'eth0',
'vlan_id': 111,
'address': '192.168.111.10',
'netmask': '255.255.255.0'
},
'second': {'device': 'eth0',
'vlan_id': 222,
'address': '192.168.222.10',
'netmask': '255.255.255.0'
}
},
})
def test_network_create_interface(self):
cmd = 'ifconfig | grep "^eth0\.[0-9][0-9]*"|wc -l'
error_msg = 'There must be two eth0 subinterfaces.'
run_result = self.remote.execute(cmd)
assert run_result['stdout'][0].strip() == '2', error_msg