Set lock_path correctly.
[openstack-build/neutron-build.git] / neutron / tests / api / admin / test_extension_driver_port_security_admin.py
1 # Copyright 2015 Cisco Systems, Inc.
2 # All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 #    not use this file except in compliance with the License. You may obtain
6 #    a copy of the License at
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #    Unless required by applicable law or agreed to in writing, software
11 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 #    License for the specific language governing permissions and limitations
14 #    under the License.
15
16 from neutron.tests.api import base
17 from neutron.tests.api import base_security_groups as base_security
18 from neutron.tests.tempest import test
19 from tempest_lib import exceptions as lib_exc
20
21
22 class PortSecurityAdminTests(base_security.BaseSecGroupTest,
23                              base.BaseAdminNetworkTest):
24
25     @test.attr(type=['negative', 'smoke'])
26     @test.idempotent_id('d39a96e2-2dea-4feb-8093-e7ac991ce6f8')
27     def test_create_port_security_false_on_shared_network(self):
28         network = self.create_shared_network()
29         self.assertTrue(network['shared'])
30         self.create_subnet(network, client=self.admin_client)
31         self.assertRaises(lib_exc.Forbidden, self.create_port,
32                           network, port_security_enabled=False)