Skip to content

Testing

Lauren Greenhill edited this page Apr 24, 2023 · 8 revisions

Unit Tests

To efficiently run tests use the following flags: pio test -f "name of your test" -e "name of your environment"

For example: pio test -f test_burnwire -e debug-linux

Environments can be found in the .ini file. If pio is not recognized by your terminal click the "Platform: IO New Terminal" arrow icon next to the socket icon.

Simulator Tests

IMU Report

Procedure:

  1. switch the pio environment to "simulator" at the bottom bar of VSCode.
  2. On the first iteration of the main control loop, transition to mandatory burns as the mission mode
  3. Upload your code to the FlatSat
  4. Leave the FlatSat at rest for a couple seconds
  5. Then, carefully shake it a little bit
  6. Leave it at rest for the remainder of the data collection
  7. Once the simulator starts printing out the IMU reports it received, ensure the report values roughly match your actions with shaking the FlatSat. For example, if the instructions above were followed, the report should first have a lot of values close to "7D" (125) which represents zero rad/s. These should be followed by some larger and smaller values during the time the tester was shaking, then more 7D values at the end.

Nanoracks Tests

Fault

  • Trigger fault by heating temperature sensor outside of normal range.
  • Monitor voltage of burn wire mosfet gate pin.
  • Ensure fault is reported in Normal Report.

Low Power

  • Ensure CubeSat enters a low power mode when voltage is less than 3.75V.
  • Ensure CubeSat exits a low power mode when voltage is greater than 3.9V.
  • Monitor voltage of burn wire mosfet gate pin.

Power off CubeSat

  • Monitor voltage of burn wire mosfet gate pin.

Burn Sequence

  • Send command to fire before arm/deployment mode command.
  • Send command to arm before deployment mode command.
  • Ensure arm command times out if fire command is not received in designated time.

Command

  • Send command with incorrect format.

End to End Testing

Code changes

  • Use Use E2E_TESTING Flag
  • Add the following to the execute of the MainControlLoop sfr::rockblock::downlink_period = 0; sfr::acs::on_time = 0; sfr::stabilization::max_time = 0;
Clone this wiki locally