From: mengli.zhang Date: Fri, 20 Jan 2017 15:12:58 +0000 (-0500) Subject: [mobile][wearable][nfc][change path for supporting global user and sync test case... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad5b8a06f54911536e10bf718e8c550b6af9c327;p=test%2Ftct%2Fweb%2Fapi.git [mobile][wearable][nfc][change path for supporting global user and sync test case from suprem] Change-Id: I848fae63b9d24a5d7f7b1919fce0f56c9afba875 Signed-off-by: mengli.zhang --- diff --git a/mobile/tct-nfc-tizen-tests/inst.wgt.py b/mobile/tct-nfc-tizen-tests/inst.wgt.py index 5b1718da1..93ac8ad71 100644 --- a/mobile/tct-nfc-tizen-tests/inst.wgt.py +++ b/mobile/tct-nfc-tizen-tests/inst.wgt.py @@ -20,7 +20,15 @@ tct_parser = ConfigParser.ConfigParser() tct_parser.read(TCT_CONFIG_FILE) SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30') PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME) +EXECUTION_MODE_30 = tct_parser.get('DEVICE', 'DEVICE_EXECUTION_MODE_30') +ADMIN_USER_30 = tct_parser.get('DEVICE', 'DEVICE_ADMIN_USER_30') +def userCheck(): + global GLOVAL_OPT + if ADMIN_USER_30 == EXECUTION_MODE_30: + GLOVAL_OPT="--global" + else: + GLOVAL_OPT="" def doCMD(cmd): # Do not need handle timeout in this short script, let tool do it @@ -116,7 +124,7 @@ def uninstPKGs(): action_status = False continue (return_code, output) = doRemoteCMD( - "pkgcmd -u -t wgt -q -n %s" % pkg_id) + "pkgcmd %s -u -t wgt -q -n %s" % (GLOVAL_OPT, pkg_id)) for line in output: if "Failure" in line: action_status = False @@ -145,7 +153,7 @@ def instPKGs(): if not doRemoteCopy(os.path.join(root, file), "%s/%s" % (SRC_DIR, file)): action_status = False (return_code, output) = doRemoteCMD( - "pkgcmd -i -t wgt -q -p %s/%s" % (SRC_DIR, file)) + "pkgcmd %s -i -t wgt -q -p %s/%s" % (GLOVAL_OPT, SRC_DIR, file)) doRemoteCMD("rm -rf %s/%s" % (SRC_DIR, file)) for line in output: if "Failure" in line: @@ -187,7 +195,7 @@ def main(): sys.exit(1) if not PARAMETERS.user: - PARAMETERS.user = "owner" + PARAMETERS.user = EXECUTION_MODE_30 if not PARAMETERS.mode: PARAMETERS.mode = "SDB" @@ -205,6 +213,8 @@ def main(): print "No device provided" sys.exit(1) + userCheck() + user_info = getUSERID() re_code = user_info[0] if re_code == 0 : diff --git a/mobile/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html b/mobile/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html index 2a1277779..bb0760811 100644 --- a/mobile/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html +++ b/mobile/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html @@ -48,7 +48,7 @@ var t = async_test(document.title, {timeout: 90000}), adapter, eventCallback, li t.step(function () { eventCallback = t.step_func(function (eventdata) { assert_own_property(eventdata, "length", "HCEEventData does not own length property."); - check_readonly(eventdata, eventdata.length, "number", eventdata.length + 1); + check_readonly(eventdata, "length", eventdata.length, "number", eventdata.length + 1); adapter.removeHCEEventListener(listenerId); t.done(); }); diff --git a/mobile/tct-nfc-tizen-tests/resources/testharness.js b/mobile/tct-nfc-tizen-tests/resources/testharness.js index 9311cd350..17ba37d24 100644 --- a/mobile/tct-nfc-tizen-tests/resources/testharness.js +++ b/mobile/tct-nfc-tizen-tests/resources/testharness.js @@ -358,8 +358,8 @@ policies and contribution forms [3]. // default timeout is 5 seconds, test can override if needed var settings = { output:true, - timeout:5000, - test_timeout:2000 + timeout:50000, + test_timeout:20000 }; var xhtml_ns = "http://www.w3.org/1999/xhtml"; diff --git a/wearable/tct-nfc-tizen-tests/inst.wgt.py b/wearable/tct-nfc-tizen-tests/inst.wgt.py index 5b1718da1..b48c5c232 100644 --- a/wearable/tct-nfc-tizen-tests/inst.wgt.py +++ b/wearable/tct-nfc-tizen-tests/inst.wgt.py @@ -20,7 +20,15 @@ tct_parser = ConfigParser.ConfigParser() tct_parser.read(TCT_CONFIG_FILE) SRC_DIR = tct_parser.get('DEVICE', 'DEVICE_SUITE_TARGET_30') PKG_SRC_DIR = "%s/tct/opt/%s" % (SRC_DIR, PKG_NAME) +EXECUTION_MODE_30 = tct_parser.get('DEVICE', 'DEVICE_EXECUTION_MODE_30') +ADMIN_USER_30 = tct_parser.get('DEVICE', 'DEVICE_ADMIN_USER_30') +def userCheck(): + global GLOVAL_OPT + if ADMIN_USER_30 == EXECUTION_MODE_30: + GLOVAL_OPT="--global" + else: + GLOVAL_OPT="" def doCMD(cmd): # Do not need handle timeout in this short script, let tool do it @@ -116,7 +124,7 @@ def uninstPKGs(): action_status = False continue (return_code, output) = doRemoteCMD( - "pkgcmd -u -t wgt -q -n %s" % pkg_id) + "pkgcmd %s -u -t wgt -q -n %s" % (GLOVAL_OPT, pkg_id)) for line in output: if "Failure" in line: action_status = False @@ -145,13 +153,22 @@ def instPKGs(): if not doRemoteCopy(os.path.join(root, file), "%s/%s" % (SRC_DIR, file)): action_status = False (return_code, output) = doRemoteCMD( - "pkgcmd -i -t wgt -q -p %s/%s" % (SRC_DIR, file)) + "pkgcmd %s -i -t wgt -q -p %s/%s" % (GLOVAL_OPT, SRC_DIR, file)) + doRemoteCMD("rm -rf %s/%s" % (SRC_DIR, file)) + for line in output: + if "Failure" in line: + action_status = False + break + if file.endswith(".tpk"): + if not doRemoteCopy(os.path.join(root, file), "%s/%s" % (SRC_DIR, file)): + action_status = False + (return_code, output) = doRemoteCMD( + "pkgcmd -i -t tpk -q -p %s/%s" % (SRC_DIR, file)) doRemoteCMD("rm -rf %s/%s" % (SRC_DIR, file)) for line in output: if "Failure" in line: action_status = False break - # Do some special copy/delete... steps ''' (return_code, output) = doRemoteCMD( @@ -187,7 +204,7 @@ def main(): sys.exit(1) if not PARAMETERS.user: - PARAMETERS.user = "owner" + PARAMETERS.user = EXECUTION_MODE_30 if not PARAMETERS.mode: PARAMETERS.mode = "SDB" @@ -205,6 +222,8 @@ def main(): print "No device provided" sys.exit(1) + userCheck() + user_info = getUSERID() re_code = user_info[0] if re_code == 0 : diff --git a/wearable/tct-nfc-tizen-tests/nfc/HCEEventData_apdu_attribute.html b/wearable/tct-nfc-tizen-tests/nfc/HCEEventData_apdu_attribute.html index ab6e115b8..2893ec259 100644 --- a/wearable/tct-nfc-tizen-tests/nfc/HCEEventData_apdu_attribute.html +++ b/wearable/tct-nfc-tizen-tests/nfc/HCEEventData_apdu_attribute.html @@ -40,9 +40,7 @@ Authors: //==== SPEC Tizen Web API:Communication:NFC:HCEEventData:apdu A //==== TEST_CRITERIA AE AT ARO -setup({timeout: 90000}); - -var t = async_test(document.title, {timeout: 90000}), adapter, listener, listenerId; +var t = async_test(document.title), adapter, listener, listenerId; t.step(function () { listener = t.step_func(function (eventdata) { diff --git a/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html b/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html index 2a1277779..933ef59f1 100644 --- a/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html +++ b/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html @@ -48,13 +48,13 @@ var t = async_test(document.title, {timeout: 90000}), adapter, eventCallback, li t.step(function () { eventCallback = t.step_func(function (eventdata) { assert_own_property(eventdata, "length", "HCEEventData does not own length property."); - check_readonly(eventdata, eventdata.length, "number", eventdata.length + 1); + check_readonly(eventdata, "length", eventdata.length, "number", eventdata.length + 1); adapter.removeHCEEventListener(listenerId); t.done(); }); adapter = tizen.nfc.getDefaultAdapter(); listenerId = adapter.addHCEEventListener(eventCallback); - assert_type(listenerId, "number", "fail to get listener Id"); + assert_type(listenerId, "long", "fail to get listener Id"); }); diff --git a/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_sendHostAPDUResponse.html b/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_sendHostAPDUResponse.html index 1afd94228..4058cab44 100644 --- a/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_sendHostAPDUResponse.html +++ b/wearable/tct-nfc-tizen-tests/nfc/NFCAdapter_sendHostAPDUResponse.html @@ -55,13 +55,17 @@ t.step(function () { assert_unreached("onerror invoked."); }); - adapter = tizen.nfc.getDefaultAdapter(); + listener = t.step_func(function (eventdata) { try { retValue = adapter.sendHostAPDUResponse(apdu_response, successCB, errorCB); assert_type(retValue, "undefined", "fail to get wrong type of retValue"); } catch (e) { assert_unreached(e.name + ": " + e.message); } + }); + + adapter = tizen.nfc.getDefaultAdapter(); + listenerId = adapter.addHCEEventListener(listener); }); diff --git a/wearable/tct-nfc-tizen-tests/tests.xml b/wearable/tct-nfc-tizen-tests/tests.xml index 01282c6ff..77ab0c84c 100644 --- a/wearable/tct-nfc-tizen-tests/tests.xml +++ b/wearable/tct-nfc-tizen-tests/tests.xml @@ -1013,7 +1013,10 @@ Click "Run" . Attach device or send APDU using another device to trigger the onDetect CB. - pass - onDetect listener should be called + + + Send APDU data from the other device to test target. + pass - HCEEventListener is called successfully. /opt/tct-nfc-tizen-tests/nfc/HCEEventData_eventType_attribute.html @@ -1025,7 +1028,10 @@ Click "Run" . Attach device or send APDU using another device to trigger the onDetect CB. - pass - onDetect listener should be called + + + Send APDU data from the other device to test target. + pass - HCEEventListener is called successfully. /opt/tct-nfc-tizen-tests/nfc/HCEEventData_extend.html @@ -1037,7 +1043,10 @@ Click "Run" . Attach device or send APDU using another device to trigger the onDetect CB. - pass - onDetect listener should be called + + + Send APDU data from the other device to test target. + pass - HCEEventListener is called successfully. /opt/tct-nfc-tizen-tests/nfc/HCEEventData_length_attribute.html @@ -1059,7 +1068,10 @@ Click "Run". Move other device with HCE close so it will be detected. - Pass + + + Send APDU data from the other device to test target. + pass - HCEEventListener is called successfully. /opt/tct-nfc-tizen-tests/nfc/HCEEventReceiveCallback_ondetected.html @@ -1071,7 +1083,10 @@ Click "Run". Move other device with HCE close so it will be detected. - pass - HCE detected + + + Send APDU data from the other device to test target. + pass - HCEEventListener is called successfully. /opt/tct-nfc-tizen-tests/nfc/NFCAdapter_addHCEEventListener.html @@ -1320,7 +1335,10 @@ Click "Run". Move other device with HCE close so it will be detected. - pass - HCE event detected + + + Send APDU data from the other device to test target. + pass - HCEEventListener is called and removed successfully and /opt/tct-nfc-tizen-tests/nfc/NFCAdapter_removeHCEEventListener.html @@ -1337,7 +1355,10 @@ Click "Run". Move other device with HCE close so it will be detected. - pass - HCE detected + + + Send APDU data from the other device to test target. + pass - APDU data is sent in HCEEventListener /opt/tct-nfc-tizen-tests/nfc/NFCAdapter_sendHostAPDUResponse.html