Refactor tempest common
[functest.git] / functest / opnfv_tests / openstack / trunk / trunk.py
1 #!/usr/bin/env python
2
3 # Copyright (c) 2018 Orange and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9
10 # pylint: disable=missing-docstring
11
12 from six.moves import configparser
13
14 from functest.opnfv_tests.openstack.tempest import tempest
15
16
17 class TempestNeutronTrunk(tempest.TempestCommon):
18     """Tempest neutron trunk testcase implementation."""
19
20     def configure(self, **kwargs):
21         super(TempestNeutronTrunk, self).configure(**kwargs)
22         rconfig = configparser.RawConfigParser()
23         rconfig.read(self.conf_file)
24         rconfig.set('network-feature-enabled', 'api_extensions', 'all')
25         with open(self.conf_file, 'wb') as config_file:
26             rconfig.write(config_file)
27         self.backup_tempest_config(self.conf_file, self.res_dir)