From 6cd3aed0077d6cced71417a48f92527ef1ecbd3e Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Thu, 23 Nov 2017 00:00:47 +0000 Subject: Remove main() and __main__ from tests. Removes the unnecessary main() functions from tests. Also removes shebang (#!) where it appears at the top of files. JIRA: YARDSTICK-861 Change-Id: I79180d1eb9c5bce640142dd62ce28c7437c1b210 Signed-off-by: Emma Foley --- .../tests/unit/benchmark/scenarios/networking/test_iperf3.py | 9 --------- .../tests/unit/benchmark/scenarios/networking/test_netperf.py | 9 --------- .../unit/benchmark/scenarios/networking/test_netperf_node.py | 9 --------- .../unit/benchmark/scenarios/networking/test_netutilization.py | 2 -- .../benchmark/scenarios/networking/test_networkcapacity.py | 2 -- .../tests/unit/benchmark/scenarios/networking/test_nstat.py | 8 -------- .../tests/unit/benchmark/scenarios/networking/test_ping.py | 9 --------- .../tests/unit/benchmark/scenarios/networking/test_ping6.py | 9 --------- .../tests/unit/benchmark/scenarios/networking/test_pktgen.py | 8 -------- .../unit/benchmark/scenarios/networking/test_pktgen_dpdk.py | 8 -------- .../scenarios/networking/test_pktgen_dpdk_throughput.py | 9 --------- .../tests/unit/benchmark/scenarios/networking/test_sfc.py | 9 --------- .../tests/unit/benchmark/scenarios/networking/test_vsperf.py | 10 ---------- .../unit/benchmark/scenarios/networking/test_vsperf_dpdk.py | 8 -------- 14 files changed, 109 deletions(-) (limited to 'yardstick/tests/unit/benchmark/scenarios/networking') diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_iperf3.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_iperf3.py index 4d3745230..d6636383a 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_iperf3.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_iperf3.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # @@ -193,10 +191,3 @@ class IperfTestCase(unittest.TestCase): with open(output) as f: sample_output = f.read() return sample_output - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py index d82a00931..5907562c2 100755 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. # @@ -121,10 +119,3 @@ class NetperfTestCase(unittest.TestCase): with open(output) as f: sample_output = f.read() return sample_output - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf_node.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf_node.py index 8be9bb94d..956a9c078 100755 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf_node.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf_node.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. # @@ -121,10 +119,3 @@ class NetperfNodeTestCase(unittest.TestCase): with open(output) as f: sample_output = f.read() return sample_output - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_netutilization.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_netutilization.py index 1227e056e..4cdfde6b1 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_netutilization.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_netutilization.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and other. # diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_networkcapacity.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_networkcapacity.py index 3e7a3c5ee..36e8c8a77 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_networkcapacity.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_networkcapacity.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. # diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_nstat.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_nstat.py index 7dd5351b1..b02d58437 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_nstat.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_nstat.py @@ -103,11 +103,3 @@ class NstatTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, n.run, result) - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py index 06353249a..4adfab120 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # @@ -92,10 +90,3 @@ class PingTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, p.run, result) - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping6.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping6.py index d2be6f576..4662c8537 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_ping6.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_ping6.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # @@ -116,10 +114,3 @@ class PingTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.side_effect = [ (0, 'host1', ''), (1, '', 'FOOBAR')] self.assertRaises(RuntimeError, p.run, result) - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen.py index acd9027d3..6aea03aee 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen.py @@ -665,11 +665,3 @@ class PktgenTestCase(unittest.TestCase): expected_result["packets_received"] = 149300 expected_result["packetsize"] = 60 self.assertEqual(result, expected_result) - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py index 99399abdc..976087148 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk.py @@ -176,11 +176,3 @@ class PktgenDPDKLatencyTestCase(unittest.TestCase): self.mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR') self.assertRaises(RuntimeError, p.run, result) - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk_throughput.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk_throughput.py index 1b12bd507..e90fb07c7 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk_throughput.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_pktgen_dpdk_throughput.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python ############################################################################## # Copyright (c) 2017 Nokia and others. # @@ -192,11 +191,3 @@ class PktgenDPDKTestCase(unittest.TestCase): mock_ssh.SSH().execute.assert_called_with( "sudo /dpdk/destdir/bin/dpdk-procinfo -- --stats-reset > /dev/null 2>&1") - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_sfc.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_sfc.py index 78c0352dd..a5e5e39dc 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_sfc.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_sfc.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # @@ -68,10 +66,3 @@ class SfcTestCase(unittest.TestCase): self.sfc.setup() self.sfc.run(result) self.sfc.teardown() - - -def main(): - unittest.main() - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf.py index be8ac55d0..419605b26 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # Copyright 2016 Intel Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -126,11 +124,3 @@ class VsperfTestCase(unittest.TestCase): result = {} self.assertRaises(RuntimeError, p.run, result) - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf_dpdk.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf_dpdk.py index 1923960e9..1d2278e21 100644 --- a/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf_dpdk.py +++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_vsperf_dpdk.py @@ -211,11 +211,3 @@ class VsperfDPDKTestCase(unittest.TestCase): result = {} self.assertRaises(RuntimeError, self.scenario.run, result) - - -def main(): - unittest.main() - - -if __name__ == '__main__': - main() -- cgit 1.2.3-korg