Skip to content

Commit

Permalink
ptest restructuring that will be rebased out
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekrol committed Apr 15, 2021
1 parent e2b65ad commit fddd3a1
Show file tree
Hide file tree
Showing 58 changed files with 1,164 additions and 1,742 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/hootl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,36 @@ jobs:
- name: CI Checkout Case and Empty case
run: |
python -m ptest runsim -c ptest/configs/ci.json -t CICase -ni
python -m ptest runsim -c ptest/configs/ci.json -t EmptyCase -ni
python -m ptest runsim -c ptest/configs/ci.json -t EmptySimCase -ni
!(python -m ptest runsim -c ptest/configs/ci.json -t FailingEmptyCase -ni)
!(python -m ptest runsim -c ptest/configs/ci.json -t FailingEmptySimCase -ni)
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t CICase -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t EmptyCase -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t EmptySimCase -ni
!(python -m ptest runsim -c ptest/configs/hootl_speedup.json -t FailingEmptyCase -ni)
!(python -m ptest runsim -c ptest/configs/hootl_speedup.json -t FailingEmptySimCase -ni)
- name: Boot Utility Cases
run: |
python -m ptest runsim -c ptest/configs/hootl.json -t BootToStartupCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t BootToDetumbleCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t BootToStandbyCase -ni
- name: Hardware Checkout Cases
run: |
python -m ptest runsim -c ptest/configs/ci.json -t DCDCCheckoutCase -ni
python -m ptest runsim -c ptest/configs/ci_realtime.json -t GomspaceCheckoutCase -ni
python -m ptest runsim -c ptest/configs/ci.json -t SpinMotorsCase -ni
python -m ptest runsim -c ptest/configs/ci.json -t ADCSCheckoutCase -ni
python -m ptest runsim -c ptest/configs/ci.json -t PiksiCheckoutCase -ni
python -m ptest runsim -c ptest/configs/ci.json -t PropStateMachineCase -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t DCDCCheckoutCase -ni
python -m ptest runsim -c ptest/configs/hootl.json -t GomspaceCheckoutCase -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t SpinMotorsCase -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t ADCSCheckoutCase -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t PiksiCheckoutCase -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t PropStateMachineCase -ni
- name: Fault Handling Cases
run: |
python -m ptest runsim -c ptest/configs/ci.json -t ADCSWheelFaultHandler -ni
python -m ptest runsim -c ptest/configs/ci.json -t LowBattFaultHandler -ni
python -m ptest runsim -c ptest/configs/ci.json -t PropFaultHandler -ni
python -m ptest runsim -c ptest/configs/ci.json -t QuakePowerCycling -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t ADCSWheelFaultHandler -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t LowBattFaultHandler -ni
python -m ptest runsim -c ptest/configs/hootl.json -t PropFaultHandler -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t QuakePowerCycling -ni
# Add quake and piksi fault handler to the above once completed.

- name: Mission Checkout Cases
run: |
python -m ptest runsim -c ptest/configs/ci.json -t DeploymentToInitHold -ni
python -m ptest runsim -c ptest/configs/ci.json -t DeploymentToStandby -ni
python -m ptest runsim -c ptest/configs/hootl_speedup.json -t DeploymentToInitHold -ni
12 changes: 6 additions & 6 deletions ptest/cases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
# Testcases that require simulation
from .empty_case import EmptySimCase, FailingEmptySimCase
from .dual_empty_case import DualEmptySimCase
from .deployment_to_standby import DeploymentToStandby
from .quake_fault_handler import QuakeFaultHandler
from .piksi_fault_handler import PiksiFaultHandler
from .autonomous_mission_manager_case import AutonomousMissionManagerCase
from .autonomous_mission_manager_pure_radio import AutonomousMissionController

from .psim_debug import PsimDebug
from .dual_psim import DualPsim
# from .base import *

from .psim_debug import PSimDebug
from .dual_psim import DualPSim

# Testcases that don't require simulation
from .empty_case import EmptyCase, NothingCase, FailingEmptyCase
from .boot_to import BootToStartupCase, BootToDetumbleCase, BootToStandbyCase
from .empty_case import EmptyCase, FailingEmptyCase
from .dual_empty_case import DualEmptyCase
from .ditl_case import DitlCase
from .gomspace_checkout_case import GomspaceCheckoutCase, CheckBatteryLevel
Expand Down
9 changes: 5 additions & 4 deletions ptest/cases/adcs_checkout_case.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ADCSCheckoutCase. Verifies the functionality of the ADCS.
from .base import SingleSatOnlyCase
from .base import SingleSatCase
from .utils import Enums, mag_of, sum_of_differentials
import math
import time
Expand All @@ -18,7 +18,7 @@ def list_of_avgs(lists_of_vals):
len_of_each = len(lists_of_vals[0])
return [sum_of_each[i]/len_of_each for i in lists_of_vals]

class ADCSCheckoutCase(SingleSatOnlyCase):
class ADCSCheckoutCase(SingleSatCase):
def assert_vec_within(self, expected, actual, delta):
assert(len(expected) == len(actual))
length = len(expected)
Expand All @@ -27,7 +27,8 @@ def assert_vec_within(self, expected, actual, delta):
self.soft_assert(abs(expected[i]-actual[i]) < delta,
f"Element #{i}, Expected {expected[i]}, got {actual[i]}. Diff exceed delta of {delta}.")

def setup_post_bootsetup(self):
def post_boot(self):
self.ws("pan.state", Enums.mission_states["manual"])
self.print_header("Begin ADCS Checkout Case")

self.ws("cycle.auto", False)
Expand Down Expand Up @@ -325,7 +326,7 @@ def ssa_checkout(self):
self.soft_assert(sum_of_differentials(list_of_voltages) > 0,
"SSA voltage readings did not vary across readings.")

def run_case_singlesat(self):
def run(self):

self.print_rs("adcs_monitor.functional")

Expand Down
129 changes: 0 additions & 129 deletions ptest/cases/autonomous_mission_manager_case.py

This file was deleted.

25 changes: 3 additions & 22 deletions ptest/cases/autonomous_mission_manager_pure_radio.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base import MissionCase
from .base import AMCCase
import time
from psim.sims import DualAttitudeOrbitGnc, SingleOrbitGnc
from psim import Configuration, Simulation
Expand All @@ -13,8 +13,7 @@ class OrbitData(NamedTuple):
vel: list
time: list


class AutonomousMissionController(MissionCase):
class AutonomousMissionController(AMCCase):
def state_check(self, satellite, designation):
satellite_state = satellite.read_state("pan.state")
if satellite_state == str(Enums.mission_states["standby"]):
Expand Down Expand Up @@ -107,25 +106,7 @@ def propagate_orbits(self, orbit, propagation_time=10 * 60 * 1000000000):
)
return propagatedOrbit

@property
def sim_configs(self):
configs = ["truth/ci", "truth/base"]
configs += ["sensors/base"]
return configs

@property
def sim_model(self):
return DualAttitudeOrbitGnc

@property
def sim_mapping(self):
return "ci_mapping.json"

@property
def sim_duration(self):
return 0

def run_case_fullmission(self):
def run(self):

# setup
self.leader = self.radio_leader
Expand Down
Loading

0 comments on commit fddd3a1

Please sign in to comment.