bootz - openconfig/featureprofiles GitHub Wiki
Ensures the device can booted via bootz with various initial configurations
Each test should send the different configuration options required in a bootz request. The device should always start with a empty configuration and start the bootstrap process.
The results should validate the expected state of the device for each configuration option set. For negative tests the device should exit with clear message and immediately go back into the bootz mode. At the end of the negative test cycle the test must provide a valid initial configuration to allow the device to be restored into a valid state.
- Start bootserver test instance
- Store bootserver IP:port to be used by DHCP server
- Get the DUT MAC address for mgmt ports
- Configure DHCP service with those mgmt ports to return a DHCP offer with the URI
bootz://<ip>:<port>
- OPTION_V4_SZTP_REDIRECT(136)
- OPTION_V6_SZTP_REDIRECT(143)
- Store the required device image on the bootserver
- Store the base valid device configuration on the bootserver
This test validates that the device can start in bootz mode and upon getting a bootz response from bootserver can initialize the devices configuration into the provided configuration.
ID | Case | Result |
---|---|---|
bootz-1.1 | Missing configuration | Device fails with status invalid parameter |
bootz-1.2 | Invalid configuration | Device fails with status invalid parameter |
bootz-1.3 | Valid configuration | Device succeded with status ok |
-
Provide bootstrap reponse configured as prescribed.
-
Initiate bootz boot on device via gnoi.FactoryReset()
-
Validate device sends bootz request to bootserver
-
Validate device telemetry
-
/system/bootz/state/last-boot-attempt
is in expected state -
/system/bootz/state/error-count
is in incremented if failure case -
/system/bootz/state/status
is in expected state -
/system/bootz/state/checksum
matches sent proto
-
-
Validate device state
- OS version is the same
- System configuration is as expected.
This test validates the bootz behavior based changes to software version.
ID | Case | Result |
---|---|---|
bootz-2.1 | Software version is different | Device is upgraded to the new version |
bootz-2.2 | Invalid software image | Device fails with status invalid parameter |
- Validate the device is on a different version from the expected new version.
- Provide bootstrap reponse configured as prescribed.
- Initiate bootz boot on device via gnoi.FactoryReset()
- Validate device sends bootz request to bootserver
- Validate the progress periodically by polling
/system/bootz/state/status
- The status should transition from:
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_OS_UPGRADE_IN_PROGRESS
- BOOTZ_OS_UPGRADE_COMPLETE
- BOOTZ_CONFIGURATION_APPLIED
- BOOTZ_OK
- For error case device should report
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_OS_UPGRADE_IN_PROGRESS
- BOOTZ_OS_INVALID_IMAGE
- The status should transition from:
- Validate device telemetry
-
/system/bootz/state/last-boot-attempt
is in expected state -
/system/bootz/state/error-count
is in incremented if failure case -
/system/bootz/state/status
is in expected state -
/system/bootz/state/checksum
matches sent proto
-
- Validate device state
- OS version is the same
- System configuration is as expected.
The purpose of this test is to validate that the ownership voucher can be sent to the device and properly handled.
ID | Case | Result |
---|---|---|
bootz-3.1 | No ownership voucher | Device boots without OV present |
bootz-3.2 | Invalid OV | Device fails with status invalid parameter |
bootz-3.3 | OV fails | Device fails with status invalid parameter |
bootz-3.4 | OV valid | Device boots with OV installed |
- Provide bootstrap reponse configured as prescribed.
- Initiate bootz boot on device via gnoi.FactoryReset()
- Validate device sends bootz request to bootserver
- Validate the progress periodically by polling
/system/bootz/state/status
- The status should transition from:
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_CONFIGURATION_APPLIED
- BOOTZ_OK
- For error case device should report
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_OV_INVALID
- The status should transition from:
- Validate device telemetry
-
/system/bootz/state/last-boot-attempt
is in expected state -
/system/bootz/state/error-count
is in incremented if failure case -
/system/bootz/state/status
is in expected state -
/system/bootz/state/checksum
matches sent proto
-
- Validate device state
- System configuration is as expected.
The purpose of this test is to validate that when providing an invalid or non bootable image the device properly handles this and resets itself into bootz mode.
ID | Case | Result |
---|---|---|
bootz-4.1 | no OS provided | Device boots with existing image |
bootz-4.2 | Invalid OS image provided | Device fails with status invalid parameter |
bootz-4.3 | failed to fetch image from remote URL | Device fails with status invalid parameter |
bootz-4.4 | OS checksum doesn't match | Device fails with invalid parameter |
- Provide bootstrap reponse configured as prescribed.
- Initiate bootz boot on device via gnoi.FactoryReset()
- Validate device sends bootz request to bootserver
- Validate the progress periodically by polling
/system/bootz/state/status
- The status should transition from:
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_CONFIGURATION_APPLIED
- BOOTZ_OK
- For error case device should report
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_OS_INVALID_IMAGE
- The status should transition from:
- Validate device telemetry
-
/system/bootz/state/last-boot-attempt
is in expected state -
/system/bootz/state/error-count
is in incremented if failure case -
/system/bootz/state/status
is in expected state -
/system/bootz/state/checksum
matches sent proto
-
- Validate device state
- System configuration is as expected.
The purpose of this test is to validate that gNSI artifacts are properly loaded by the bootz process. If the artifacts are incomplete an error will be returned.
ID | Case | Result |
---|---|---|
bootz-5.1 | no gNSI artifacts are provided | Device boots with services default security policies |
bootz-5.2 | gNSI certz policy is sent CA trust bundle | Device creates new policy with CA bundle set |
bootz-5.3 | gNSI ca auth policy provided | Device fails with status invalid parameter |
bootz-5.4 | gNSI Authz policy | Device fails with invalid parameter |
- Provide bootstrap reponse configured as prescribed.
- Initiate bootz boot on device via gnoi.FactoryReset()
- Validate device sends bootz request to bootserver
- Validate the progress periodically by subscribing to
/system/bootz/state/status
- The status should transition from:
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_CONFIGURATION_APPLIED
- BOOTZ_OK
- For error case device should report
- BOOTZ_UNSPECIFIED
- BOOTZ_SENT
- BOOTZ_RECEIVED
- BOOTZ_OS_INVALID_IMAGE
- The status should transition from:
- Validate device telemetry
-
/system/bootz/state/last-boot-attempt
is in expected state -
/system/bootz/state/error-count
is in incremented if failure case -
/system/bootz/state/status
is in expected state -
/system/bootz/state/checksum
matches sent proto
-
- Validate device state
- System configuration is as expected.
paths:
/system/bootz/state/last-boot-attempt:
/system/bootz/state/error-count:
/system/bootz/state/status:
/system/bootz/state/checksum:
rpcs:
gnmi:
gNMI.Subscribe:
on_change: true
gnoi:
bootconfig.BootConfig.GetBootConfig:
bootconfig.BootConfig.SetBootConfig:
bootz:
Bootstrap.GetBootstrapData:
Bootstrap.ReportStatus: