Revision 0775d2bd kamaki/clients/livetest/cyclades.py

b/kamaki/clients/livetest/cyclades.py
596 596
        net1 = dict(self.network1)
597 597
        net1.pop('updated')
598 598
        self.assert_dicts_are_deeply_equal(chosen, net1)
599
        for param, val in dict(
600
                cidr='192.168.0.0/24',
601
                gateway='192.168.0.1',
599
        full_args = dict(
600
                cidr='192.168.1.0/24',
601
                gateway='192.168.1.1',
602 602
                type='MAC_FILTERED',
603
                dhcp=True).items():
603
                dhcp=True)
604
        try_args = dict(all=True)
605
        try_args.update(full_args)
606
        for param, val in try_args.items():
604 607
            print('\tdelete %s to avoid max net limit' % n1id)
605 608
            self._delete_network(n1id)
606
            kwargs = {param: val}
609
            kwargs = full_args if param == 'all' else {param: val}
607 610
            print('\twith %s=%s' % (param, val))
608 611
            self.network1 = self._create_network(self.netname1, **kwargs)
609 612
            n1id = self.network1['id']
610 613
            self._wait_for_network(n1id, 'ACTIVE')
611 614
            self.network1 = self.client.get_network_details(n1id)
612
            self.assertEqual(self.network1[param], val)
615
            if param == 'all':
616
                for p, v in full_args.items():
617
                    self.assertEqual(self.network1[p], v)
618
            else:
619
                self.assertEqual(self.network1[param], val)
613 620

  
614 621
    def test_connect_server(self):
615 622
        """Test connect_server"""
......
701 708
        self._wait_for_status(self.server1['id'], 'BUILD')
702 709
        self._wait_for_network(self.network1['id'], 'ACTIVE')
703 710
        self._wait_for_network(self.network2['id'], 'ACTIVE')
711
        self.client.connect_server(self.server1['id'], self.network1['id'])
704 712
        self.client.connect_server(self.server1['id'], self.network2['id'])
713
        self._wait_for_nic(self.network1['id'], self.server1['id'])
705 714
        self._wait_for_nic(self.network2['id'], self.server1['id'])
706 715
        self._test_0293_list_network_nics()
707 716

  
......
709 718
        netid1 = self.network1['id']
710 719
        netid2 = self.network2['id']
711 720
        r = self.client.list_network_nics(netid1)
712
        expected = []
721
        expected = ['nic-%s-1' % self.server1['id']]
713 722
        self.assertEqual(r, expected)
714 723
        r = self.client.list_network_nics(netid2)
715
        expected = ['nic-%s-1' % self.server1['id']]
724
        expected = ['nic-%s-2' % self.server1['id']]
716 725
        self.assertEqual(r, expected)
717 726

  
718 727
    def test_get_network_details(self):

Also available in: Unified diff