Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Dec 9, 2022
1 parent 9589758 commit 92518e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ jobs:
--app-args "--discriminator 3840 --interface-id -1" \
--tool-path out/linux-x64-java-matter-controller \
--tool-cluster "discover" \
--tool-args "--nodeid 1 --fabricid 1" \
--tool-args "commissionables" \
--factoryreset \
'
scripts/run_in_build_env.sh \
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/java/commissioning_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# limitations under the License.
#

# Commissioning test.
import logging
import os
import sys
Expand Down
57 changes: 20 additions & 37 deletions scripts/tests/java/discover_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# limitations under the License.
#

# Discovery test.
import logging
import os
import sys
Expand All @@ -26,7 +25,7 @@
import subprocess
import threading
import typing
from optparse import OptionParser
import argparse
from colorama import Fore, Style
from java.base import DumpProgramOutputToQueue

Expand All @@ -37,40 +36,22 @@ def __init__(self, thread_list: typing.List[threading.Thread], queue: queue.Queu
self.queue = queue
self.command = cmd

optParser = OptionParser()
optParser.add_option(
"--nodeid",
action="store",
dest="nodeid",
default='1',
type='str',
help="DNS-SD name corresponding with the given node ID",
metavar="<nodeid>"
)
optParser.add_option(
"--fabricid",
action="store",
dest="fabricid",
default='1',
type='str',
help="DNS-SD name corresponding with the given fabric ID",
metavar="<nodeid>"
)
optParser.add_option(
"-p",
"--paa-trust-store-path",
action="store",
dest="paaTrustStorePath",
default='',
type='str',
help="Path that contains valid and trusted PAA Root Certificates.",
metavar="<paa-trust-store-path>"
)
parser = argparse.ArgumentParser(description='Process discover arguments.')

(options, remainingArgs) = optParser.parse_args(args.split())
parser.add_argument('command', help="Command name")
parser.add_argument('-n', '--nodeid', help="DNS-SD name corresponding with the given node ID", default = '1')
parser.add_argument('-f', '--fabricid', help="DNS-SD name corresponding with the given fabric ID", default = '1')
parser.add_argument('-p', '--paa-trust-store-path', help="Path that contains valid and trusted PAA Root Certificates")

self.nodeid = options.nodeid
self.fabricid = options.fabricid
args = parser.parse_args(args.split())

self.command_name = args.command
self.nodeid = args.nodeid
self.fabricid = args.fabricid

print("yujuan:self.command_name:" + self.command_name)
print("yujuan:self.nodeid:" + self.nodeid)
print("yujuan:self.fabricid:" + self.fabricid)

logging.basicConfig(level=logging.INFO)

Expand All @@ -85,9 +66,11 @@ def TestCmdCommissionables(self):

def RunTest(self):
logging.info("Testing discovering commissionables devices")
java_exit_code = self.TestCmdCommissionables()
if java_exit_code != 0:
logging.error("Testing command commissionables failed with error %r" % java_exit_code)

if self.command_name == 'commissionables':
java_exit_code = self.TestCmdCommissionables()
if java_exit_code != 0:
logging.error("Testing command commissionables failed with error %r" % java_exit_code)
return java_exit_code

# Testing complete without errors
Expand Down

0 comments on commit 92518e2

Please sign in to comment.