1 # Copyright (c) 2014 OpenStack Foundation.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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
16 from neutron.cmd.sanity import checks
17 from neutron.tests import base
18 from neutron.tests.functional import base as functional_base
21 class SanityTestCase(base.BaseTestCase):
22 """Sanity checks that do not require root access.
24 Tests that just call checks.some_function() are to ensure that
25 neutron-sanity-check runs without throwing an exception, as in the case
26 where someone modifies the API without updating the check script.
30 super(SanityTestCase, self).setUp()
32 def test_nova_notify_runs(self):
33 checks.nova_notify_supported()
35 def test_dnsmasq_version(self):
36 checks.dnsmasq_version_supported()
38 def test_dibbler_version(self):
39 checks.dibbler_version_supported()
41 def test_ipset_support(self):
42 checks.ipset_supported()
44 def test_ip6tables_support(self):
45 checks.ip6tables_supported()
48 class SanityTestCaseRoot(functional_base.BaseSudoTestCase):
49 """Sanity checks that require root access.
51 Tests that just call checks.some_function() are to ensure that
52 neutron-sanity-check runs without throwing an exception, as in the case
53 where someone modifies the API without updating the check script.
56 def test_ovs_vxlan_support_runs(self):
57 checks.ovs_vxlan_supported()
59 def test_ovs_geneve_support_runs(self):
60 checks.ovs_geneve_supported()
62 def test_iproute2_vxlan_support_runs(self):
63 checks.iproute2_vxlan_supported()
65 def test_ovs_patch_support_runs(self):
66 checks.patch_supported()
68 def test_arp_responder_runs(self):
69 checks.arp_responder_supported()
71 def test_arp_header_match_runs(self):
72 checks.arp_header_match_supported()
74 def test_icmpv6_header_match_runs(self):
75 checks.icmpv6_header_match_supported()
77 def test_vf_management_runs(self):
78 checks.vf_management_supported()
80 def test_namespace_root_read_detection_runs(self):
81 checks.netns_read_requires_helper()
83 def test_ovsdb_native_supported_runs(self):
84 checks.ovsdb_native_supported()
86 def test_keepalived_ipv6_support(self):
87 checks.keepalived_ipv6_supported()