def test_configure_resource_no_nic(self): crm = common.CRM() vip_svc = common.VirtualIP('apache', '10.110.1.1') vip_svc.configure_resource(crm) self.assertEqual(crm['resources']['res_apache_a7815c8_vip'], 'ocf:heartbeat:IPaddr2') self.assertEqual(crm['resource_params']['res_apache_a7815c8_vip'], (' params ip="10.110.1.1" ' 'op monitor depth="0" timeout="20s" interval="10s"'))
def test_configure_resource(self): crm = common.CRM() vip_svc = common.VirtualIP('apache', '10.110.1.1', 'eth1', '24') vip_svc.configure_resource(crm) self.assertEqual(crm['resources']['res_apache_eth1_vip'], 'ocf:heartbeat:IPaddr2') self.assertEqual( crm['resource_params']['res_apache_eth1_vip'], (' params ip="10.110.1.1" nic="eth1" cidr_netmask="24" ' 'op monitor depth="0" timeout="20s" interval="10s"'))
def test_init_no_default(self): vip_svc = common.VirtualIP('apache', '10.110.1.1', 'eth1', '24') self.assertEqual(vip_svc.service_name, 'apache') self.assertEqual(vip_svc.vip, '10.110.1.1') self.assertEqual(vip_svc.nic, 'eth1') self.assertEqual(vip_svc.cidr, '24')
def test_init(self): vip_svc = common.VirtualIP('apache', '10.110.1.1') self.assertEqual(vip_svc.service_name, 'apache') self.assertEqual(vip_svc.vip, '10.110.1.1') self.assertIsNone(vip_svc.nic) self.assertIsNone(vip_svc.cidr)