summaryrefslogtreecommitdiff
path: root/test-cli/test
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test')
-rw-r--r--test-cli/test/tests/qplc.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test-cli/test/tests/qplc.py b/test-cli/test/tests/qplc.py
index a70ae3a..27bbbea 100644
--- a/test-cli/test/tests/qplc.py
+++ b/test-cli/test/tests/qplc.py
@@ -4,6 +4,8 @@ import os.path
import os
import sh
import stat
+import time
+import ping3
from test.helpers.md5 import md5_file
from test.helpers.plc import dcpPLC
@@ -32,11 +34,12 @@ class Qplc(unittest.TestCase):
self.__gen_mac = varlist.get('gen_mac', self.__xmlObj.getKeyVal(self.__QPLCName, "gen_mac", "0"))
self.__mtd_device = varlist.get('mtd_device', self.__xmlObj.getKeyVal(self.__QPLCName, "mtd_device", "/dev/mtd0"))
self.__firmware_Path = varlist.get('firmwarepath', self.__xmlObj.getKeyVal(self.__QPLCName, "firmwarepath", "/root/hwtest-files/firmware"))
- self.__plc_test_ip = varlist.get('plc_test_ip', self.__xmlObj.getKeyVal(self.__QPLCName, "plc_test_ip", "192.168.60.91"))
+ self.__plc_test_ip = varlist.get('plc_test_ip', self.__xmlObj.getKeyVal(self.__QPLCName, "plc_test_ip", "10.10.1.254"))
self.__skipflash = varlist.get('skipflash', self.__xmlObj.getKeyVal(self.__QPLCName, "skipflash", "0"))
self.__plc = dcpPLC(self.__factoryTool, self.__mtd_device)
self.__factory_password = varlist.get('factory_password', self.__xmlObj.getKeyVal(self.__QPLCName, "factory_password", "0"))
self.__firmware_password = varlist.get('firmware_password', self.__xmlObj.getKeyVal(self.__QPLCName, "firmware_password", "0"))
+ self.__plc_reset_wait = varlist.get('plc_reset_wait', self.__xmlObj.getKeyVal(self.__QPLCName, "plc_reset_wait", "60"))
self.__resultlist = []
@@ -88,6 +91,14 @@ class Qplc(unittest.TestCase):
#plcMAC = res[0][0]
#self.__plc.set_plc('SYSTEM.PRODUCTION.MAC_ADDR', '{}'.format(plcMAC), self.__firmware_password)
self.__plc.setPLCReset()
+ time.sleep(int(self.__plc_reset_wait))
+ # ping against the GPLC0000 board
+ ping3.EXCEPTIONS = True
+ try:
+ ping3.ping(self.__plc_test_ip, timeout=0.1)
+ except:
+ self.fail('PLC ping timeout')
+
def getresults(self):
return self.__resultlist