Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more test cases to the OTA provider test #27874

Merged
merged 30 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ad89080
Add more test cases to the OTA provider test
nivi-apple Jul 10, 2023
5315657
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 10, 2023
b5b7564
Restyled by whitespace
restyled-commits Jul 10, 2023
a657741
Restyled by clang-format
restyled-commits Jul 10, 2023
a1b5107
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 10, 2023
9745e42
Apply suggestions from code review
nivi-apple Jul 14, 2023
0491257
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 20, 2023
866edd0
Review comments
nivi-apple Jul 20, 2023
1e9e380
Add check for discriminator 1113 to MTRCommissionableBrowserTests.m
nivi-apple Jul 20, 2023
e4d1e53
Restyled by clang-format
restyled-commits Jul 20, 2023
547977e
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 21, 2023
cc00fd4
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 21, 2023
93e750b
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 21, 2023
2e67bbf
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 21, 2023
1626284
Fix kExpectedDiscoveredDevicesCount for MTRCommissionableBrowserTests…
nivi-apple Jul 21, 2023
44e4101
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 24, 2023
e5ecd11
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 24, 2023
2aa7ff2
Decommission device3 after OTA tests are done
nivi-apple Jul 24, 2023
c56a06a
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 24, 2023
7986bbd
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 25, 2023
2c4900d
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 25, 2023
2eea30a
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 25, 2023
e2aaba4
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 25, 2023
7bfa759
Update src/darwin/Framework/CHIPTests/MTROTAProviderTests.m
nivi-apple Jul 26, 2023
7b0435a
Apply suggestions from code review
nivi-apple Jul 26, 2023
9831a0b
Addressed review comments
nivi-apple Jul 27, 2023
94c5619
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 27, 2023
a302d39
Apply suggestions from code review
nivi-apple Jul 28, 2023
1099880
more review comments
nivi-apple Jul 28, 2023
05a3279
Merge branch 'master' into add_more_ota_tests
nivi-apple Jul 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ jobs:
- name: Build example OTA Provider
run: |
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false
- name: Build OTA image files with software version number 5
- name: Build OTA image files with software version number 5 and 10
run: |
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 chip_device_config_device_software_version=5 chip_device_config_device_software_version_string='"5.0"'
cp out/debug/chip-ota-requestor-app /tmp/ota-test005-raw-image
cp out/debug/chip-ota-requestor-app /tmp/ota-raw-image-v5
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 chip_device_config_device_software_version=10 chip_device_config_device_software_version_string='"10.0"'
cp out/debug/chip-ota-requestor-app /tmp/ota-raw-image-v10
- name: Build example OTA Requestor
run: |
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0
Expand All @@ -120,6 +122,7 @@ jobs:
# And a different port from the test harness too; the test harness uses port 5541.
../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5542 --discriminator 1111 --KVS /tmp/chip-ota-requestor-kvs1 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image1 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-1.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-1.log >&2) &
../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5543 --discriminator 1112 --KVS /tmp/chip-ota-requestor-kvs2 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image2 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-2.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-2.log >&2) &
../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5544 --discriminator 1113 --KVS /tmp/chip-ota-requestor-kvs3 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image3 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-3.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-3.log >&2) &
nivi-apple marked this conversation as resolved.
Show resolved Hide resolved
# Disable BLE because the app does not have the permission to use
# it and that may crash the CI.
#
Expand Down
10 changes: 6 additions & 4 deletions src/darwin/Framework/CHIPTests/MTRCommissionableBrowserTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
static const uint16_t kTestProductId2 = 0x8001u;
static const uint16_t kTestDiscriminator1 = 1111u;
static const uint16_t kTestDiscriminator2 = 1112u;
static const uint16_t kTestDiscriminator3 = 3840u;
static const uint16_t kTestDiscriminator4 = 3839u;
static const uint16_t kTestDiscriminator3 = 1113u;
static const uint16_t kTestDiscriminator4 = 3840u;
static const uint16_t kTestDiscriminator5 = 3839u;
static const uint16_t kDiscoverDeviceTimeoutInSeconds = 10;
static const uint16_t kExpectedDiscoveredDevicesCount = 4;
static const uint16_t kExpectedDiscoveredDevicesCount = 5;

// Singleton controller we use.
static MTRDeviceController * sController = nil;
Expand Down Expand Up @@ -77,7 +78,8 @@ - (void)controller:(MTRDeviceController *)controller didFindCommissionableDevice
XCTAssertEqualObjects(vendorId, @(kTestVendorId));
XCTAssertTrue([productId isEqual:@(kTestProductId1)] || [productId isEqual:@(kTestProductId2)]);
XCTAssertTrue([discriminator isEqual:@(kTestDiscriminator1)] || [discriminator isEqual:@(kTestDiscriminator2)] ||
[discriminator isEqual:@(kTestDiscriminator3)] || [discriminator isEqual:@(kTestDiscriminator4)]);
[discriminator isEqual:@(kTestDiscriminator3)] || [discriminator isEqual:@(kTestDiscriminator4)] ||
[discriminator isEqual:@(kTestDiscriminator5)]);
XCTAssertEqual(commissioningMode, YES);

NSLog(@"Found Device (%@) with discriminator: %@ (vendor: %@, product: %@)", instanceName, discriminator, vendorId, productId);
Expand Down
Loading