@@ -0,0 +1,1168 @@
+#!/usr/bin/env python3%0A%0A# This script allows to run a traffic generator outside%0A# the testcase. E.g. on a manual setup!%0A%0A# add path to library root%0Aimport sys%0Aimport os%0Asys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))%0A%0Afrom framework import MBIT, Testbed, TestEnv, processes, traffic%0Afrom framework.traffic import greedy, udp%0A%0Adef run_test(test_fn):%0A%0A    testbed = Testbed()%0A    testenv = TestEnv(testbed, is_interactive=True)%0A%0A    def run_traffic(traffic_fn, **kwargs):%0A        traffic_fn(%0A            dry_run=False,%0A            testbed=testbed,%0A            hint_fn=lambda hint: None,%0A            run_fn=testenv.run,%0A            **kwargs,%0A        )%0A%0A    test_fn(run_traffic)%0A%0A    sys.stdout.write('Press enter to stop traffic and cleanup ')%0A    input()%0A%0A    processes.kill_known_pids()%0A    testenv.get_terminal().cleanup()%0A%0Aif __name__ == '__main__':%0A    def test(run_traffic):%0A        run_traffic(greedy, node='a')%0A        run_traffic(greedy, node='b')%0A        #run_traffic(udp, node='a', bitrate=150*MBIT, ect='nonect')  # ect1,nonect%0A        #run_traffic(udp, node='b', bitrate=150*MBIT, ect='ect1')  # ect1,nonect%0A%0A    run_test(test)%0A

Add util for running traffic generators outside test