blob: 2c6a99e03b026ad6a470e527d09ee71ced81b857 [file] [log] [blame]
Yi Tseng0cb9b562021-09-22 17:13:58 -07001# SPDX-FileCopyrightText: Copyright 2021-present Open Networking Foundation.
2# SPDX-License-Identifier: GPL-2.0-or-later
3
4from tests.dependencies.Network import Network
5
6class IntTest:
7
8 def __init__(self, scapy=False):
9 self.hosts = ["h1", "h2", "h3"]
10 self.scapy = scapy
11
12 def setUpTest(self, main):
13 main.Network = Network()
14 main.Network.connectToNet()
15
16 for host in self.hosts:
17 main.Network.createHostComponent(host)
18 if self.scapy:
19 hostHandle = getattr(main, host)
20 hostHandle.sudoRequired = True
21 hostHandle.startScapy()
22
23 def cleanUp(self, main):
24 for host in self.hosts:
25 if self.scapy:
26 hostHandle = getattr(main, host)
27 hostHandle.stopScapy()
28 main.Network.removeHostComponent(host)
29 main.Network.disconnectFromNet()