Skip to content

Commit 61dde7a

Browse files
authored
Merge branch 'master' into feature/fix-tv-app-install-flow-and-supported-clusters
2 parents 77d2074 + ab42d43 commit 61dde7a

File tree

160 files changed

+10364
-1348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+10364
-1348
lines changed

.clang-tidy

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Checks: >
1212
readability-redundant-string-init,
1313
-bugprone-assignment-in-if-condition,
1414
-bugprone-branch-clone,
15+
-bugprone-casting-through-void, #TODO remove this after fixing issues in source code, issue 34008
1516
-bugprone-copy-constructor-init,
1617
-bugprone-easily-swappable-parameters,
1718
-bugprone-forward-declaration-namespace,

.gitmodules

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
[submodule "third_party/boringssl/repo/src"]
253253
path = third_party/boringssl/repo/src
254254
url = https://github.com/google/boringssl.git
255+
branch = master
255256
[submodule "third_party/mt793x_sdk/filogic"]
256257
path = third_party/mt793x_sdk/filogic
257258
url = https://github.com/MediaTek-Labs/genio-matter-bsp.git

BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
161161
"${chip_root}/examples/shell/standalone:chip-shell",
162162
"${chip_root}/src/app/tests/integration:chip-im-initiator",
163163
"${chip_root}/src/app/tests/integration:chip-im-responder",
164+
"${chip_root}/src/inet/tests:inet-layer-test-tool",
164165
"${chip_root}/src/lib/address_resolve:address-resolve-tool",
165166
"${chip_root}/src/messaging/tests/echo:chip-echo-requester",
166167
"${chip_root}/src/messaging/tests/echo:chip-echo-responder",

build/chip/tests.gni

100644100755
+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717

18+
import("${chip_root}/build/chip/tools.gni")
1819
import("${chip_root}/src/platform/device.gni")
1920

2021
declare_args() {
@@ -40,6 +41,6 @@ declare_args() {
4041
}
4142

4243
declare_args() {
43-
# Enable use of nlfaultinjection.
44-
chip_with_nlfaultinjection = chip_build_tests
44+
# Enable use of nlfaultinjection when building tests or when building tools.
45+
chip_with_nlfaultinjection = chip_build_tests || chip_build_tools
4546
}

config/common/cmake/chip_gn.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ macro(matter_build target)
158158
${CHIP_ROOT}/src/include
159159
${CHIP_ROOT}/third_party/nlassert/repo/include
160160
${CHIP_ROOT}/third_party/nlio/repo/include
161+
${CHIP_ROOT}/third_party/nlfaultinjection/include
161162
${CHIP_ROOT}/zzz_generated/app-common
162163
${CMAKE_CURRENT_BINARY_DIR}/gen/include
163164
)

credentials/development/gen_commissioner_dut_test_plan_table.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def main():
8686
with open(path, 'r') as f:
8787
j = json.loads(f.read())
8888
success_expected = j['is_success_case'].lower() == 'true'
89-
pid = 177 if 'fallback_encoding' in p else 32768
90-
desc = TestInfo(desc=j['description'], dir=p, pid=pid)
89+
desc = TestInfo(desc=j['description'], dir=p, pid=int(j['basic_info_pid']))
9190
if success_expected:
9291
success_cases.append(desc)
9392
else:

credentials/fetch-paa-certs-from-dcl.py credentials/fetch_paa_certs_from_dcl.py

+56-13
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
PRODUCTION_NODE_URL_REST = "https://on.dcl.csa-iot.org"
3838
TEST_NODE_URL_REST = "https://on.test-net.dcl.csa-iot.org"
3939

40+
MATTER_CERT_CA_SUBJECT = "MFIxDDAKBgNVBAoMA0NTQTEsMCoGA1UEAwwjTWF0dGVyIENlcnRpZmljYXRpb24gYW5kIFRlc3RpbmcgQ0ExFDASBgorBgEEAYKifAIBDARDNUEw"
41+
MATTER_CERT_CA_SUBJECT_KEY_ID = "97:E4:69:D0:C5:04:14:C2:6F:C7:01:F7:7E:94:77:39:09:8D:F6:A5"
42+
4043

4144
def parse_paa_root_certs(cmdpipe, paa_list):
4245
"""
@@ -73,13 +76,14 @@ def parse_paa_root_certs(cmdpipe, paa_list):
7376
else:
7477
if b': ' in line:
7578
key, value = line.split(b': ')
76-
result[key.strip(b' -').decode("utf-8")] = value.strip().decode("utf-8")
79+
result[key.strip(b' -').decode("utf-8")
80+
] = value.strip().decode("utf-8")
7781
parse_paa_root_certs.counter += 1
7882
if parse_paa_root_certs.counter % 2 == 0:
7983
paa_list.append(copy.deepcopy(result))
8084

8185

82-
def write_paa_root_cert(certificate, subject):
86+
def write_cert(certificate, subject):
8387
filename = 'dcld_mirror_' + \
8488
re.sub('[^a-zA-Z0-9_-]', '', re.sub('[=, ]', '_', subject))
8589
with open(filename + '.pem', 'w+') as outfile:
@@ -93,7 +97,8 @@ def write_paa_root_cert(certificate, subject):
9397
serialization.Encoding.DER)
9498
outfile.write(der_certificate)
9599
except (IOError, ValueError) as e:
96-
print(f"ERROR: Failed to convert {filename + '.pem'}: {str(e)}. Skipping...")
100+
print(
101+
f"ERROR: Failed to convert {filename + '.pem'}: {str(e)}. Skipping...")
97102

98103

99104
def parse_paa_root_cert_from_dcld(cmdpipe):
@@ -133,7 +138,38 @@ def use_dcld(dcld, production, cmdlist):
133138
@optgroup.option('--paa-trust-store-path', default='paa-root-certs', type=str, metavar='PATH', help="PAA trust store path (default: paa-root-certs)")
134139
def main(use_main_net_dcld, use_test_net_dcld, use_main_net_http, use_test_net_http, paa_trust_store_path):
135140
"""DCL PAA mirroring tools"""
141+
fetch_paa_certs(use_main_net_dcld, use_test_net_dcld, use_main_net_http, use_test_net_http, paa_trust_store_path)
142+
143+
144+
def get_cert_from_rest(rest_node_url, subject, subject_key_id):
145+
response = requests.get(
146+
f"{rest_node_url}/dcl/pki/certificates/{subject}/{subject_key_id}").json()["approvedCertificates"]["certs"][0]
147+
certificate = response["pemCert"].rstrip("\n")
148+
subject = response["subjectAsText"]
149+
return certificate, subject
150+
151+
152+
def fetch_cd_signing_certs(store_path):
153+
''' Only supports using main net http currently.'''
154+
rest_node_url = PRODUCTION_NODE_URL_REST
155+
os.makedirs(store_path, exist_ok=True)
156+
original_dir = os.getcwd()
157+
os.chdir(store_path)
136158

159+
cd_signer_ids = requests.get(
160+
f"{rest_node_url}/dcl/pki/child-certificates/{MATTER_CERT_CA_SUBJECT}/{MATTER_CERT_CA_SUBJECT_KEY_ID}").json()['childCertificates']['certIds']
161+
for signer in cd_signer_ids:
162+
subject = signer['subject']
163+
subject_key_id = signer['subjectKeyId']
164+
certificate, subject = get_cert_from_rest(rest_node_url, subject, subject_key_id)
165+
166+
print(f"Downloaded CD signing cert with subject: {subject}")
167+
write_cert(certificate, subject)
168+
169+
os.chdir(original_dir)
170+
171+
172+
def fetch_paa_certs(use_main_net_dcld, use_test_net_dcld, use_main_net_http, use_test_net_http, paa_trust_store_path):
137173
production = False
138174
dcld = use_test_net_dcld
139175

@@ -148,36 +184,43 @@ def main(use_main_net_dcld, use_test_net_dcld, use_main_net_http, use_test_net_h
148184
rest_node_url = PRODUCTION_NODE_URL_REST if production else TEST_NODE_URL_REST
149185

150186
os.makedirs(paa_trust_store_path, exist_ok=True)
187+
original_dir = os.getcwd()
151188
os.chdir(paa_trust_store_path)
152189

153190
if use_rest:
154-
paa_list = requests.get(f"{rest_node_url}/dcl/pki/root-certificates").json()["approvedRootCertificates"]["certs"]
191+
paa_list = requests.get(
192+
f"{rest_node_url}/dcl/pki/root-certificates").json()["approvedRootCertificates"]["certs"]
155193
else:
156194
cmdlist = ['query', 'pki', 'all-x509-root-certs']
157195

158-
cmdpipe = subprocess.Popen(use_dcld(dcld, production, cmdlist), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
196+
cmdpipe = subprocess.Popen(use_dcld(
197+
dcld, production, cmdlist), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
159198

160199
paa_list = []
161200
parse_paa_root_certs.counter = 0
162201
parse_paa_root_certs(cmdpipe, paa_list)
163202

164203
for paa in paa_list:
204+
if paa['subject'] == MATTER_CERT_CA_SUBJECT and paa['subjectKeyId'] == MATTER_CERT_CA_SUBJECT_KEY_ID:
205+
# Don't include the CD signing cert as a PAA root.
206+
continue
165207
if use_rest:
166-
response = requests.get(
167-
f"{rest_node_url}/dcl/pki/certificates/{paa['subject']}/{paa['subjectKeyId']}").json()["approvedCertificates"]["certs"][0]
168-
certificate = response["pemCert"]
169-
subject = response["subjectAsText"]
208+
certificate, subject = get_cert_from_rest(rest_node_url, paa['subject'], paa['subjectKeyId'])
170209
else:
171-
cmdlist = ['query', 'pki', 'x509-cert', '-u', paa['subject'], '-k', paa['subjectKeyId']]
210+
cmdlist = ['query', 'pki', 'x509-cert', '-u',
211+
paa['subject'], '-k', paa['subjectKeyId']]
172212

173-
cmdpipe = subprocess.Popen(use_dcld(dcld, production, cmdlist), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
213+
cmdpipe = subprocess.Popen(use_dcld(
214+
dcld, production, cmdlist), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
174215

175216
(certificate, subject) = parse_paa_root_cert_from_dcld(cmdpipe)
176217

177218
certificate = certificate.rstrip('\n')
178219

179-
print(f"Downloaded certificate with subject: {subject}")
180-
write_paa_root_cert(certificate, subject)
220+
print(f"Downloaded PAA certificate with subject: {subject}")
221+
write_cert(certificate, subject)
222+
223+
os.chdir(original_dir)
181224

182225

183226
if __name__ == "__main__":

docs/testing/yaml.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,16 @@ NOTE: use the target appropriate to your system
349349

350350
[chiptool.py](https://github.com/project-chip/connectedhomeip/blob/master/scripts/tests/chipyaml/chiptool.py)
351351
can be used to run tests against a commissioned DUT (commissioned by chip-tool).
352-
This will start an interactive instance of chip-tool automatically.
352+
To commission a DUT using chip-tool use the pairing command. For example:
353+
354+
```
355+
./out/linux-x64-chip-tool/chip-tool pairing code 0x12344321 MT:-24J0AFN00KA0648G00
356+
```
357+
358+
In this example, 0x12344321 is the node ID (0x12344321 is the test default) and
359+
MT:-24J0AFN00KA0648G00 is the QR code.
360+
361+
The chiptool.py tool can then be used to run the tests. For example:
353362

354363
```
355364
./scripts/tests/chipyaml/chiptool.py tests Test_TC_OO_2_1 --server_path ./out/linux-x64-chip-tool/chip-tool

examples/air-purifier-app/air-purifier-common/air-purifier-app.zap

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"fileFormat": 2,
3-
"featureLevel": 100,
3+
"featureLevel": 103,
44
"creator": "zap",
55
"keyValuePairs": [
66
{
@@ -29,6 +29,7 @@
2929
"pathRelativity": "relativeToZap",
3030
"path": "../../../src/app/zap-templates/app-templates.json",
3131
"type": "gen-templates-json",
32+
"category": "matter",
3233
"version": "chip-v1"
3334
}
3435
],

examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"fileFormat": 2,
3-
"featureLevel": 100,
3+
"featureLevel": 103,
44
"creator": "zap",
55
"keyValuePairs": [
66
{
@@ -29,6 +29,7 @@
2929
"pathRelativity": "relativeToZap",
3030
"path": "../../../src/app/zap-templates/app-templates.json",
3131
"type": "gen-templates-json",
32+
"category": "matter",
3233
"version": "chip-v1"
3334
}
3435
],

examples/all-clusters-app/all-clusters-common/all-clusters-app.zap

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"fileFormat": 2,
3-
"featureLevel": 102,
3+
"featureLevel": 103,
44
"creator": "zap",
55
"keyValuePairs": [
66
{
@@ -29,6 +29,7 @@
2929
"pathRelativity": "relativeToZap",
3030
"path": "../../../src/app/zap-templates/app-templates.json",
3131
"type": "gen-templates-json",
32+
"category": "matter",
3233
"version": "chip-v1"
3334
}
3435
],
@@ -8226,7 +8227,6 @@
82268227
"define": "OPERATIONAL_STATE_OVEN_CLUSTER",
82278228
"side": "server",
82288229
"enabled": 1,
8229-
"apiMaturity": "provisional",
82308230
"commands": [
82318231
{
82328232
"name": "Pause",
@@ -8487,7 +8487,6 @@
84878487
"define": "OVEN_MODE_CLUSTER",
84888488
"side": "server",
84898489
"enabled": 1,
8490-
"apiMaturity": "provisional",
84918490
"commands": [
84928491
{
84938492
"name": "ChangeToMode",
@@ -8644,7 +8643,6 @@
86448643
"define": "LAUNDRY_DRYER_CONTROLS_CLUSTER",
86458644
"side": "server",
86468645
"enabled": 1,
8647-
"apiMaturity": "provisional",
86488646
"attributes": [
86498647
{
86508648
"name": "SupportedDrynessLevels",
@@ -10898,7 +10896,6 @@
1089810896
"define": "MICROWAVE_OVEN_MODE_CLUSTER",
1089910897
"side": "server",
1090010898
"enabled": 1,
10901-
"apiMaturity": "provisional",
1090210899
"attributes": [
1090310900
{
1090410901
"name": "SupportedModes",
@@ -12202,7 +12199,6 @@
1220212199
"define": "BOOLEAN_STATE_CONFIGURATION_CLUSTER",
1220312200
"side": "server",
1220412201
"enabled": 1,
12205-
"apiMaturity": "provisional",
1220612202
"commands": [
1220712203
{
1220812204
"name": "SuppressAlarm",
@@ -12471,7 +12467,6 @@
1247112467
"define": "VALVE_CONFIGURATION_AND_CONTROL_CLUSTER",
1247212468
"side": "server",
1247312469
"enabled": 1,
12474-
"apiMaturity": "provisional",
1247512470
"commands": [
1247612471
{
1247712472
"name": "Open",
@@ -12788,7 +12783,6 @@
1278812783
"define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER",
1278912784
"side": "server",
1279012785
"enabled": 1,
12791-
"apiMaturity": "provisional",
1279212786
"attributes": [
1279312787
{
1279412788
"name": "PowerMode",
@@ -13208,7 +13202,6 @@
1320813202
"define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER",
1320913203
"side": "server",
1321013204
"enabled": 1,
13211-
"apiMaturity": "provisional",
1321213205
"attributes": [
1321313206
{
1321413207
"name": "Accuracy",
@@ -13580,7 +13573,7 @@
1358013573
"code": 5,
1358113574
"mfgCode": null,
1358213575
"side": "server",
13583-
"type": "array",
13576+
"type": "PowerAdjustCapabilityStruct",
1358413577
"included": 1,
1358513578
"storageOption": "External",
1358613579
"singleton": 0,
@@ -13758,7 +13751,6 @@
1375813751
"define": "ENERGY_EVSE_CLUSTER",
1375913752
"side": "server",
1376013753
"enabled": 1,
13761-
"apiMaturity": "provisional",
1376213754
"commands": [
1376313755
{
1376413756
"name": "GetTargetsResponse",
@@ -14434,7 +14426,6 @@
1443414426
"define": "POWER_TOPOLOGY_CLUSTER",
1443514427
"side": "server",
1443614428
"enabled": 1,
14437-
"apiMaturity": "provisional",
1443814429
"attributes": [
1443914430
{
1444014431
"name": "AvailableEndpoints",
@@ -14573,7 +14564,6 @@
1457314564
"define": "ENERGY_EVSE_MODE_CLUSTER",
1457414565
"side": "server",
1457514566
"enabled": 1,
14576-
"apiMaturity": "provisional",
1457714567
"commands": [
1457814568
{
1457914569
"name": "ChangeToMode",

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"fileFormat": 2,
3-
"featureLevel": 102,
3+
"featureLevel": 103,
44
"creator": "zap",
55
"keyValuePairs": [
66
{
@@ -29,6 +29,7 @@
2929
"pathRelativity": "relativeToZap",
3030
"path": "../../../src/app/zap-templates/app-templates.json",
3131
"type": "gen-templates-json",
32+
"category": "matter",
3233
"version": "chip-v1"
3334
}
3435
],

examples/bridge-app/bridge-common/bridge-app.zap

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"fileFormat": 2,
3-
"featureLevel": 100,
3+
"featureLevel": 103,
44
"creator": "zap",
55
"keyValuePairs": [
66
{
@@ -29,6 +29,7 @@
2929
"pathRelativity": "relativeToZap",
3030
"path": "../../../src/app/zap-templates/app-templates.json",
3131
"type": "gen-templates-json",
32+
"category": "matter",
3233
"version": "chip-v1"
3334
}
3435
],

0 commit comments

Comments
 (0)