~corey.bryant/ubuntu/trusty/neutron/lp1318721

« back to all changes in this revision

Viewing changes to neutron/tests/unit/vmware/nsxlib/test_router.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Corey Bryant
  • Date: 2014-10-06 09:15:06 UTC
  • mfrom: (28.1.4 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20141006091506-cesvev43moce4y74
Tags: 1:2014.1.3-0ubuntu1
[ Corey Bryant ]
* Resynchronize with stable/icehouse (4a0210e) (LP: #1377136):
  - [3a30d19] Deletes floating ip related connection states
  - [dd4b77f] Forbid regular users to reset admin-only attrs to default values
  - [dc2c893] Add delete operations for the ODL MechanismDriver
  - [b51e2c7] Add missing ml2 plugin to migration 1fcfc149aca4
  - [a17a500] Don't convert numeric protocol values to int
  - [3a85946] NSX: Optionally not enforce nat rule match length check
  - [645f984] Don't spawn metadata-proxy for non-isolated nets
  - [b464d89] Big Switch: Check for 'id' in port before lookup
  - [3116ffa] use TRUE in SQL for boolean var
  - [3520e66] call security_groups_member_updated in port_update
  - [50e1534] Don't allow user to set firewall rule with port and no protocol
  - [0061533] BSN: Add context to backend request for debugging
  - [6de6d61] Improve ODL ML2 Exception Handling
  - [2a4153d] Send network name and uuid to subnet create
  - [b5e3c9a] BSN: Allow concurrent reads to consistency DB
  - [b201432] Big Switch: Retry on 503 errors from backend
  - [f6c47ee] NSX: log request body to NSX as debug
  - [97d622a] Fix metadata agent's auth info caching
  - [255df45] NSX: Correct allowed_address_pair return value on create_port
  - [5bea041] Neutron should not use the neutronclient utils module for import_class
  - [d5314e2] Cisco N1kv plugin to send subtype on network profile creation
  - [f32d1ce] Pass object to policy when finding fields to strip
  - [8b5f6be] Call policy.init() once per API request
  - [9a6d811] Perform policy checks only once on list responses
  - [c48db90] Datacenter moid should not be tuple
  - [161d465] Allow unsharing a network used as gateway/floatingip
  - [9574a2f] Add support for router scheduling in Cisco N1kv Plugin
  - [6f54565] Fix func job hook script permission problems
  - [ea43103] Add hook scripts for the functional infra job
  - [8161cb7] Fixes Hyper-V agent issue on Hyper-V 2008 R2
  - [8e99cfd] Fixes Hyper-V issue due to ML2 RPC versioning
  - [69f9121] Ensure ip6tables are used only if ipv6 is enabled in kernel
  - [399b809] Remove explicit dependency on amqplib
  - [a872143] Clear entries in Cisco N1KV specific tables on rollback
  - [ad82fad] Verify ML2 type driver exists before calling del
  - [af2cc98] Big Switch: Only update hash header on success
  - [b1e5eec] Ignore variable column widths in ovsdb functional tests
  - [4a0210e] VMWare: don't notify on disassociate_floatingips()

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from neutron.common import exceptions
22
22
from neutron.openstack.common import uuidutils
23
23
from neutron.plugins.vmware.api_client import exception as api_exc
 
24
from neutron.plugins.vmware.api_client import version as version_module
24
25
from neutron.plugins.vmware.api_client.version import Version
25
26
from neutron.plugins.vmware.common import exceptions as nsx_exc
26
27
from neutron.plugins.vmware.common import utils
920
921
            routerlib.delete_nat_rules_by_match,
921
922
            self.fake_cluster, lrouter['uuid'],
922
923
            'SomeWeirdType', 1, 1)
 
924
 
 
925
    def test_delete_nat_rules_by_match_len_mismatch_does_not_raise(self):
 
926
        lrouter = self._prepare_nat_rules_for_delete_tests()
 
927
        rules = routerlib.query_nat_rules(self.fake_cluster, lrouter['uuid'])
 
928
        self.assertEqual(len(rules), 3)
 
929
        deleted_rules = routerlib.delete_nat_rules_by_match(
 
930
            self.fake_cluster, lrouter['uuid'],
 
931
            'DestinationNatRule',
 
932
            max_num_expected=1, min_num_expected=1,
 
933
            raise_on_len_mismatch=False,
 
934
            destination_ip_addresses='99.99.99.99')
 
935
        self.assertEqual(0, deleted_rules)
 
936
        # add an extra rule to emulate a duplicate one
 
937
        with mock.patch.object(self.fake_cluster.api_client,
 
938
                               'get_version',
 
939
                               new=lambda: version_module.Version('2.0')):
 
940
            routerlib.create_lrouter_snat_rule(
 
941
                self.fake_cluster, lrouter['uuid'],
 
942
                '10.0.0.2', '10.0.0.2', order=220,
 
943
                match_criteria={'source_ip_addresses': '192.168.0.0/24'})
 
944
        deleted_rules_2 = routerlib.delete_nat_rules_by_match(
 
945
            self.fake_cluster, lrouter['uuid'], 'SourceNatRule',
 
946
            min_num_expected=1, max_num_expected=1,
 
947
            raise_on_len_mismatch=False,
 
948
            source_ip_addresses='192.168.0.0/24')
 
949
        self.assertEqual(2, deleted_rules_2)