Skip to content

Commit 8311948

Browse files
dparausanugemini-code-assist[bot]restyled-commits
authored
[E2E][JF] Add TC_JCM_1_1 test case; Enable JointFabrics testing in CI (project-chip#39637)
* Initial JF integration test case * Spawn Python controller using EcoA and EcoB certificates in order to reuse Python infrastructure * Automatically generate Python controller storage from jfc-app storage; extract CATs from jfc-app storage and apply them to Python controller * Fix issue with script exection never ending; cleanup all storage dirs after execution. * Add comments, build automatically Subjects value to compare with the one from the device; Clean Test steps description and expected * Fix path in BUILD.gn for jfc-app; enable JFA, JFC apps build in CI; validate anchor cat and admin cat on jfa-app; switch to all-clusters-app instead of lighting-app * Update src/python_testing/matter_testing_infrastructure/chip/testing/apps.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Restyled by gn * Restyled by isort * Fix comment in script * Add JF apps in expected file * Update order of jf apps in expected output; remove function from subprocess that is not required; update paramter type to a builtin type * Add NFC pairing patch to jfc-app * Remove JF apps build artifacts; reuse the ones from artifacts folder * Export for JFA and JFC were inversed * Final artifact name is wrong for JFA and JFC apps * Add jfa and jfc apps in local.py script --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <[email protected]>
1 parent d2faf76 commit 8311948

File tree

10 files changed

+481
-2
lines changed

10 files changed

+481
-2
lines changed

.github/workflows/tests.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,15 @@ jobs:
539539
--target linux-x64-light-data-model-no-unique-id-${BUILD_VARIANT}-clang \
540540
--target linux-x64-terms-and-conditions \
541541
--target linux-x64-python-bindings \
542+
--target linux-x64-jf-control-app \
543+
--target linux-x64-jf-admin-app \
542544
build \
543545
--copy-artifacts-to objdir-clone \
544546
"
545547
- name: Generate an argument environment file
548+
# GitHub VM remains out of memory after adding Joint Fabrics example apps to be built.
549+
# Add as a temporary fix the removal of out/ folders for JF apps and use artifacts from objdir-clone (see step above) as .o files are no longer requred.
550+
# Maybe do this for all apps.
546551
run: |
547552
echo -n "" >/tmp/test_env.yaml
548553
echo "ALL_CLUSTERS_APP: out/linux-x64-all-clusters-${BUILD_VARIANT}-tsan-clang-test/chip-all-clusters-app" >> /tmp/test_env.yaml
@@ -565,6 +570,10 @@ jobs:
565570
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
566571
echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
567572
echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
573+
echo "JF_CONTROL_APP: objdir-clone/linux-x64-jf-control-app/jfc-app" >> /tmp/test_env.yaml
574+
rm -rf out/linux-x64-jf-control-app
575+
echo "JF_ADMIN_APP: objdir-clone/linux-x64-jf-admin-app/jfa-app" >> /tmp/test_env.yaml
576+
rm -rf out/linux-x64-jf-admin-app
568577
569578
- name: Verify Testing Support
570579
run: |

examples/jf-control-app/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ config("config") {
6666

6767
static_library("jfc-utils") {
6868
sources = [
69-
"${chip_root}/examples/chip-tool/CHIPCommand.h",
7069
"${chip_root}/examples/chip-tool/commands/clusters/ModelCommand.cpp",
7170
"${chip_root}/examples/chip-tool/commands/clusters/ModelCommand.h",
7271
"${chip_root}/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp",
72+
"${chip_root}/examples/chip-tool/commands/common/CHIPCommand.h",
7373
"${chip_root}/examples/chip-tool/commands/common/Command.cpp",
7474
"${chip_root}/examples/chip-tool/commands/common/Command.h",
7575
"${chip_root}/examples/chip-tool/commands/common/Commands.cpp",

examples/jf-control-app/commands/pairing/PairingCommand.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId)
122122
case PairingMode::Ble:
123123
err = Pair(remoteId, PeerAddress::BLE());
124124
break;
125+
case PairingMode::Nfc:
126+
if (mDiscriminator.has_value())
127+
{
128+
err = Pair(remoteId, PeerAddress::NFC(mDiscriminator.value()));
129+
}
130+
else
131+
{
132+
// Discriminator is mandatory
133+
err = CHIP_ERROR_MESSAGE_INCOMPLETE;
134+
}
135+
break;
125136
case PairingMode::OnNetwork:
126137
err = PairWithMdns(remoteId);
127138
break;

examples/jf-control-app/commands/pairing/PairingCommand.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ enum class PairingMode
4242
AlreadyDiscoveredByIndex,
4343
AlreadyDiscoveredByIndexWithCode,
4444
OnNetwork,
45+
Nfc,
4546
};
4647

4748
enum class PairingNetworkType
@@ -121,6 +122,11 @@ class PairingCommand : public CHIPCommand,
121122
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
122123
AddArgument("discriminator", 0, 4096, &mDiscriminator.emplace());
123124
break;
125+
case PairingMode::Nfc:
126+
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
127+
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
128+
AddArgument("discriminator", 0, 4096, &mDiscriminator.emplace());
129+
break;
124130
case PairingMode::OnNetwork:
125131
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
126132
AddArgument("pase-only", 0, 1, &mPaseOnly);

scripts/build/build/targets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def BuildHostTarget():
151151
TargetPart('terms-and-conditions', app=HostApp.TERMS_AND_CONDITIONS),
152152
TargetPart('camera', app=HostApp.CAMERA),
153153
TargetPart('camera-controller', app=HostApp.CAMERA_CONTROLLER),
154+
TargetPart('jf-control-app', app=HostApp.JF_CONTROL),
155+
TargetPart('jf-admin-app', app=HostApp.JF_ADMIN),
154156
]
155157

156158
if (HostBoard.NATIVE.PlatformName() == 'darwin'):

scripts/build/builders/host.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ class HostApp(Enum):
9191
TERMS_AND_CONDITIONS = auto()
9292
CAMERA = auto()
9393
CAMERA_CONTROLLER = auto()
94+
JF_CONTROL = auto()
95+
JF_ADMIN = auto()
9496

9597
def ExamplePath(self):
9698
if self == HostApp.ALL_CLUSTERS:
@@ -173,6 +175,10 @@ def ExamplePath(self):
173175
return 'camera-app/linux'
174176
elif self == HostApp.CAMERA_CONTROLLER:
175177
return 'camera-controller'
178+
elif self == HostApp.JF_CONTROL:
179+
return 'jf-control-app'
180+
elif self == HostApp.JF_ADMIN:
181+
return 'jf-admin-app/linux'
176182
else:
177183
raise Exception('Unknown app type: %r' % self)
178184

@@ -303,6 +309,10 @@ def OutputNames(self):
303309
elif self == HostApp.CAMERA_CONTROLLER:
304310
yield 'chip-camera-controller'
305311
yield 'chip-camera-controller.map'
312+
elif self == HostApp.JF_CONTROL:
313+
yield 'jfc-app'
314+
elif self == HostApp.JF_ADMIN:
315+
yield 'jfa-app'
306316
else:
307317
raise Exception('Unknown app type: %r' % self)
308318

scripts/build/testdata/all_targets_linux_x64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ efr32-{brd2601b,brd2605a,brd2703a,brd2704b,brd4186a,brd4186c,brd4187a,brd4187c,b
99
esp32-{c3devkit,devkitc,m5stack,qemu}-{all-clusters,all-clusters-minimal,bridge,energy-gateway,energy-management,light,lock,ota-provider,ota-requestor,ota-requestor,shell,temperature-measurement,tests}[-ipv6only][-rpc][-tracing]
1010
genio-lighting-app
1111
linux-fake-tests[-asan][-boringssl][-clang][-coverage][-dmalloc][-libfuzzer][-mbedtls][-ossfuzz][-pw-fuzztest][-tsan][-ubsan]
12-
linux-{arm64,x64}-{address-resolve-tool,air-purifier,air-quality-sensor,all-clusters,all-clusters-minimal,bridge,camera,camera-controller,chip-cert,chip-tool,contact-sensor,dishwasher,energy-gateway,energy-management,fabric-admin,fabric-bridge,fabric-sync,java-matter-controller,kotlin-matter-controller,light,light-data-model-no-unique-id,lit-icd,lock,microwave-oven,minmdns,network-manager,ota-provider,ota-requestor,python-bindings,refrigerator,rpc-console,rvc,shell,simulated-app1,simulated-app2,terms-and-conditions,tests,thermostat,tv-app,tv-casting-app,water-leak-detector}[-asan][-boringssl][-chip-casting-simplified][-clang][-coverage][-disable-dnssd-tests][-dmalloc][-enable-dnssd-tests][-evse-test-event][-googletest][-ipv6only][-libfuzzer][-libnl][-mbedtls][-minmdns-verbose][-nfc-commission][-nlfaultinject][-no-ble][-no-interactive][-no-shell][-no-thread][-no-wifi][-no-wifipaf][-nodeps][-ossfuzz][-platform-mdns][-pw-fuzztest][-rpc][-same-event-loop][-terms-and-conditions][-test][-tsan][-ubsan][-with-ui]
12+
linux-{arm64,x64}-{address-resolve-tool,air-purifier,air-quality-sensor,all-clusters,all-clusters-minimal,bridge,camera,camera-controller,chip-cert,chip-tool,contact-sensor,dishwasher,energy-gateway,energy-management,fabric-admin,fabric-bridge,fabric-sync,java-matter-controller,jf-admin-app,jf-control-app,kotlin-matter-controller,light,light-data-model-no-unique-id,lit-icd,lock,microwave-oven,minmdns,network-manager,ota-provider,ota-requestor,python-bindings,refrigerator,rpc-console,rvc,shell,simulated-app1,simulated-app2,terms-and-conditions,tests,thermostat,tv-app,tv-casting-app,water-leak-detector}[-asan][-boringssl][-chip-casting-simplified][-clang][-coverage][-disable-dnssd-tests][-dmalloc][-enable-dnssd-tests][-evse-test-event][-googletest][-ipv6only][-libfuzzer][-libnl][-mbedtls][-minmdns-verbose][-nfc-commission][-nlfaultinject][-no-ble][-no-interactive][-no-shell][-no-thread][-no-wifi][-no-wifipaf][-nodeps][-ossfuzz][-platform-mdns][-pw-fuzztest][-rpc][-same-event-loop][-terms-and-conditions][-test][-tsan][-ubsan][-with-ui]
1313
linux-x64-efr32-test-runner[-clang]
1414
imx-{all-clusters-app,all-clusters-minimal-app,chip-tool,lighting-app,ota-provider-app,thermostat}[-release]
1515
infineon-psoc6-{all-clusters,all-clusters-minimal,light,lock}[-ota][-trustm][-updateimage]

scripts/tests/local.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,20 @@ def _get_targets(coverage: Optional[bool]) -> list[ApplicationTarget]:
260260
binary="chip-camera-app",
261261
)
262262
)
263+
targets.append(
264+
ApplicationTarget(
265+
key="JF_CONTROL_APP",
266+
target=f"{target_prefix}-jf-control-app",
267+
binary="jfc-app",
268+
)
269+
)
270+
targets.append(
271+
ApplicationTarget(
272+
key="JF_ADMIN_APP",
273+
target=f"{target_prefix}-jf-admin-app",
274+
binary="jfa-app",
275+
)
276+
)
263277

264278
return targets
265279

0 commit comments

Comments
 (0)