diff options
author | Yusuke Iwase <iwase.yusuke0@gmail.com> | 2015-09-10 13:50:14 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-01 13:27:45 +0900 |
commit | b1c1adf79aa53ab5e520ebc9f5adc70ce89e8c7b (patch) | |
tree | 66128fd9a0dc702bcae1c25eaaf36adfa07b4a71 | |
parent | 40acc4bc82719e273a41c0bcfa8e42b7d182c3eb (diff) |
switch/tester: Add sleep interval for each test case
Open vSwitch, which installed with the kernel module, has a cache in
the kernel for the flow table and the cached flow entries have a
hard timeout of 5 seconds.
tester.py attempts to confirm its flow modifications with a barrier
request, but Open vSwitch sends a barrier reply back regardless of
the the state of the cached entries in the kernel module.
So in some cases, Open vSwtich needs the interval between each test
case.
This patch adds an option for setting interval for the workaround.
Note: With a zero seconds interval, the whole test suite runs in
20-30 minutes, but with a 10 seconds interval between each test,
the entire suite takes 3-4 hours.
Reported-by: Alan Deikman <alan.deikman@znyx.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/flags.py | 5 | ||||
-rw-r--r-- | ryu/tests/switch/tester.py | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/ryu/flags.py b/ryu/flags.py index a6e5c980..a77bebd0 100644 --- a/ryu/flags.py +++ b/ryu/flags.py @@ -50,5 +50,8 @@ CONF.register_cli_opts([ '(default: openflow13)'), cfg.StrOpt('tester-version', default='openflow13', help='tester sw OFP version [openflow13|openflow14] ' - '(default: openflow13)') + '(default: openflow13)'), + cfg.IntOpt('interval', default=0, + help='interval time in seconds of each test ' + '(default: 0)'), ], group='test-switch') diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py index 6c4e2336..5087614b 100644 --- a/ryu/tests/switch/tester.py +++ b/ryu/tests/switch/tester.py @@ -273,6 +273,7 @@ class OfTester(app_manager.RyuApp): super(OfTester, self).__init__() self._set_logger() + self.interval = CONF['test-switch']['interval'] self.target_dpid = self._convert_dpid(CONF['test-switch']['target']) self.target_send_port_1 = CONF['test-switch']['target_send_port_1'] self.target_send_port_2 = CONF['test-switch']['target_send_port_2'] @@ -434,6 +435,7 @@ class OfTester(app_manager.RyuApp): result = self._test_execute(test, desc) report.setdefault(result, []) report[result].append([testfile.description, test.description]) + hub.sleep(self.interval) return report def _test_execute(self, test, description): |