mirror of https://github.com/ARMmbed/mbed-os.git
Autoformatting files
parent
912c4f5c05
commit
54ff956461
|
@ -12,11 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
"""
|
||||
from icetea_lib.bench import Bench
|
||||
from interface import interfaceUp, interfaceDown
|
||||
|
||||
import threading
|
||||
import time
|
||||
|
||||
from icetea_lib.bench import Bench
|
||||
from interface import interfaceUp, interfaceDown
|
||||
|
||||
|
||||
class Testcase(Bench):
|
||||
def __init__(self):
|
||||
|
@ -52,8 +54,8 @@ class Testcase(Bench):
|
|||
self.logger.info("Starting")
|
||||
time.sleep(5) # wait accept from server
|
||||
self.command("dut2", "socket " + str(self.client_socket_id) + " open")
|
||||
self.command("dut2", "socket " + str(self.client_socket_id) + " connect " + str(self.server_ip) + " " + str(self.used_port))
|
||||
|
||||
self.command("dut2", "socket " + str(self.client_socket_id) + " connect " + str(self.server_ip) + " " + str(
|
||||
self.used_port))
|
||||
|
||||
def case(self):
|
||||
self.used_port = 2000
|
||||
|
@ -95,7 +97,6 @@ class Testcase(Bench):
|
|||
self.command("dut1", "socket " + str(server_base_socket_id) + " delete")
|
||||
self.command("dut2", "socket " + str(self.client_socket_id) + " delete")
|
||||
|
||||
|
||||
def teardown(self):
|
||||
interfaceDown(self, ["dut1"])
|
||||
interfaceDown(self, ["dut2"])
|
||||
|
|
|
@ -12,10 +12,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
"""
|
||||
from icetea_lib.bench import Bench, TestStepFail
|
||||
import random
|
||||
import string
|
||||
|
||||
from icetea_lib.bench import Bench, TestStepFail
|
||||
|
||||
|
||||
class Testcase(Bench):
|
||||
def __init__(self):
|
||||
|
|
|
@ -19,6 +19,7 @@ This script is intended to be a common test data generator.
|
|||
Currently it implements randomUppercaseAsciiString, randomLowercaseAsciiString methods.
|
||||
'''
|
||||
|
||||
|
||||
def randomUppercaseAsciiString(length):
|
||||
return ''.join(random.choice(string.ascii_uppercase) for i in range(length))
|
||||
|
||||
|
|
|
@ -13,11 +13,13 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
"""
|
||||
from icetea_lib.TestStepError import TestStepFail
|
||||
|
||||
'''
|
||||
This interface script is intended to be a common library to be used in testcase scripts by testers.
|
||||
It delegates setUp and tearDown functions with different provided network interface types using setUp() and tearDown() methods.
|
||||
'''
|
||||
|
||||
|
||||
def interfaceUp(tc, duts):
|
||||
interfaces = {}
|
||||
for dut in duts:
|
||||
|
@ -35,6 +37,7 @@ def interfaceUp(tc, duts):
|
|||
interfaces.update(interface)
|
||||
return interfaces
|
||||
|
||||
|
||||
def interfaceDown(tc, duts):
|
||||
for dut in duts:
|
||||
tc.command(dut, "ifdown")
|
||||
|
|
Loading…
Reference in New Issue