5 # see license for license details
9 from vstf.agent.perf import ethtool
10 from vstf.agent.unittest import configuration
11 from vstf.common.log import setup_logging
14 LOG = logging.getLogger(__name__)
17 class Testethtool(unittest.TestCase):
19 LOG.info("start Testethtool unit test.")
20 self._devices = configuration.eth_for_test
21 super(Testethtool, self).setUp()
24 LOG.info("stop Testethtool unit test.")
26 # @unittest.skip('for now')
27 def test_autoneg_on(self):
28 for dev in self._devices:
29 self.assertTrue(ethtool.autoneg_on(dev), True)
31 def test_autoneg_off(self):
32 for dev in self._devices:
33 self.assertTrue(ethtool.autoneg_off(dev), True)
35 def test_autoneg_query(self):
36 for dev in self._devices:
37 result = ethtool.autoneg_query(dev)
40 if __name__ == "__main__":
41 setup_logging(level=logging.INFO, log_file="/var/log/vstf/vstf-unit-test.log", clevel=logging.INFO)