Skip to content

Commit

Permalink
Merge pull request #588 from ut-issl/feature/del_GENERATE_TLM_in_pytest
Browse files Browse the repository at this point in the history
Pre Release (v3.9.0-beta.7): pytest 内の古い `GENERATE_TLM` の利用を消す
  • Loading branch information
meltingrabbit authored May 24, 2023
2 parents a31e56e + d21c43b commit eee7bd9
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "c2a-core"
version = "3.9.0-beta.6"
version = "3.9.0-beta.7"
edition = "2021"

links = "c2a-core"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def ckeck_mobc_bct_ack(ti, exec_cmd, bct_id):

g_mobc_gsc_cnt += 1
tlm_MOBC = wings.util.generate_and_receive_tlm(
ope, mobc_c2a_enum.Cmd_CODE_GENERATE_TLM, mobc_c2a_enum.Tlm_CODE_MOBC
ope, mobc_c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, mobc_c2a_enum.Tlm_CODE_MOBC
)
assert tlm_MOBC["MOBC.BCT_BLK_PTR"] == bct_id
assert tlm_MOBC["MOBC.BCT_CMD_PTR"] == 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@
@pytest.mark.sils
def test_event_utility():
tlm_EH = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EH
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EH
)
assert tlm_EH["EH.EVENT_UTIL.IS_ENABLED_EH_EXECUTION"] == "ENABLE"

assert "SUC" == wings.util.send_rt_cmd_and_confirm(
ope, c2a_enum.Cmd_CODE_EVENT_UTIL_DISABLE_EH_EXEC, (), c2a_enum.Tlm_CODE_HK
)
tlm_EH = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EH
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EH
)
assert tlm_EH["EH.EVENT_UTIL.IS_ENABLED_EH_EXECUTION"] == "DISABLE"

assert "SUC" == wings.util.send_rt_cmd_and_confirm(
ope, c2a_enum.Cmd_CODE_EVENT_UTIL_ENABLE_EH_EXEC, (), c2a_enum.Tlm_CODE_HK
)
tlm_EH = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EH
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EH
)
assert tlm_EH["EH.EVENT_UTIL.IS_ENABLED_EH_EXECUTION"] == "ENABLE"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_tlcd_set_id_and_page_for_tlm():
c2a_enum.Tlm_CODE_HK,
)
tlm_TL = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_TL
)
assert tlm_TL["TL.LINE_NO"] == target_id
assert tlm_TL["TL.PAGE_NO"] == target_page
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_tlcd_send_and_clear_tl():
clear_tl_gs_and_tl_mis()

tlm_TL = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_TL
)
ti_now = tlm_TL["TL.SH.TI"]

Expand Down Expand Up @@ -250,7 +250,7 @@ def check_registered_tl_cmds(line_no, tis, cmd_id, params):
)

tlm_TL = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_TL
)
assert tlm_TL["TL.LINE_NO"] == line_no

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1785,31 +1785,31 @@ def init_el_and_eh():

def download_eh_tlm():
return wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EH
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EH
)


def download_eh_rule_tlm():
return wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EH_RULE
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EH_RULE
)


def download_eh_log_tlm():
return wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EH_LOG
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EH_LOG
)


def download_eh_index_tlm():
return wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EH_INDEX
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EH_INDEX
)


def download_el_tlm():
return wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EL
)


Expand Down Expand Up @@ -2081,7 +2081,7 @@ def get_latest_event():
print("check_latest_event")

tlm_EL = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EL
)
return (
tlm_EL["EL.LATEST_EVENT.GROUP"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ def update_el_tlm():
)

el_tlm = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EL
)

g_el_tlm = el_tlm
Expand Down Expand Up @@ -947,7 +947,7 @@ def update_el_tlog_tlm():
)

el_tlog_tlm = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EL_TLOG
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EL_TLOG
)

g_tlog_em_tlm = el_tlog_tlm
Expand Down Expand Up @@ -984,7 +984,7 @@ def update_el_clog_tlm():
)

el_clog_tlm = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_EL_CLOG
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_EL_CLOG
)

g_clog_em_tlm = el_clog_tlm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_mm_nop():
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "SUC"

# tlm_MM = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_MM
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_MM
# )
# assert tlm_MM["MM.MODE_LIST_15"] == valid_bc - 0x100 # FIXME: 0x17Eで動くようにする

Expand Down Expand Up @@ -168,7 +168,7 @@ def test_mm_nop():
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "SUC"

# tlm_MM = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_MM
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_MM
# )
# # assert tlm_MM["MM.MODE_LIST_15"] == 0x17E
# assert (
Expand All @@ -194,7 +194,7 @@ def test_mm_nop():
# c2a_enum.Tlm_CODE_HK,
# )
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "ERR"

Expand All @@ -206,7 +206,7 @@ def test_mm_nop():
# c2a_enum.Tlm_CODE_HK,
# )
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "ERR"

Expand All @@ -230,15 +230,15 @@ def test_mm_nop():
# c2a_enum.Tlm_CODE_HK,
# )
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "SUC"
# assert tlm_HK["HK.OBC.MM_OPSMODE"] == "RESERVE_3"
# assert tlm_HK["HK.OBC.MM_STS"] == "PROGRESS:G"

# time.sleep(5)
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.MM_STS"] == "FINISHED"

Expand All @@ -256,15 +256,15 @@ def test_mm_nop():
# c2a_enum.Tlm_CODE_HK,
# )
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "SUC"
# assert tlm_HK["HK.OBC.MM_OPSMODE"] == "INITIAL"
# assert tlm_HK["HK.OBC.MM_STS"] == "PROGRESS:G"

# time.sleep(5)
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.MM_STS"] == "FINISHED"

Expand All @@ -275,7 +275,7 @@ def test_mm_nop():
# c2a_enum.Tlm_CODE_HK,
# )
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "SUC"
# wings.util.send_cmd_and_confirm(
Expand All @@ -285,7 +285,7 @@ def test_mm_nop():
# c2a_enum.Tlm_CODE_HK,
# )
# tlm_HK = wings.util.generate_and_receive_tlm(
# ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
# ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
# )
# assert tlm_HK["HK.OBC.GS_CMD.LAST_EXEC.EXEC_STS"] == "SUC"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def test_tmgr_set_time():

# TL2のテレメループが途切れないように、現在時刻より未来のTIに飛ばす
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
target_ti = tlm_HK["HK.SH.TI"] + 1000

assert "SUC" == wings.util.send_rt_cmd_and_confirm(
ope, c2a_enum.Cmd_CODE_TMGR_SET_TIME, (target_ti,), c2a_enum.Tlm_CODE_HK
)
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.SH.TI"] > target_ti
assert tlm_HK["HK.SH.TI"] < target_ti + 50
Expand All @@ -63,7 +63,7 @@ def test_tmgr_set_unixtime():
)

tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
unixtime_at_ti0 = (
current_unixtime
Expand Down Expand Up @@ -97,7 +97,7 @@ def test_tmgr_set_utl_unixtime_epoch():
)

tlm_MOBC = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_MOBC
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_MOBC
)
assert tlm_MOBC["MOBC.TM_UTL_UNIXTIME_EPOCH"] == new_epoch

Expand All @@ -117,7 +117,7 @@ def test_tmgr_set_and_reset_cycle_correction():
)

tlm_MOBC = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_MOBC
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_MOBC
)
assert tlm_MOBC["MOBC.TM_CYCLES_PER_SEC_FIX_RATIO"] == set_value

Expand All @@ -127,7 +127,7 @@ def test_tmgr_set_and_reset_cycle_correction():
)

tlm_MOBC = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_MOBC
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_MOBC
)
assert tlm_MOBC["MOBC.TM_CYCLES_PER_SEC_FIX_RATIO"] == 1.0

Expand Down Expand Up @@ -158,8 +158,8 @@ def test_tmgr_utl_cmd():
wings.util.send_utl_cmd(
ope,
time.time() + 3,
c2a_enum.Cmd_CODE_GENERATE_TLM,
(0x40, c2a_enum.Tlm_CODE_GS, 1),
c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM,
(c2a_enum.Tlm_CODE_GS,),
)
wings.util.send_utl_cmd(
ope,
Expand Down Expand Up @@ -244,7 +244,7 @@ def check_utl_cmd_with(utl_unixtime_epoch, cycle_correction):

# TL_gs に正しく登録されているか確認
tlm_TL = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_TL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_TL
)
assert tlm_TL["TL.LINE_NO"] == c2a_enum.TLCD_ID_FROM_GS
assert tlm_TL["TL.PAGE_NO"] == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@
@pytest.mark.sils
def test_wdt_at_sils():
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.WDT.IS_ENABLE"] == "ENA"
assert tlm_HK["HK.WDT.IS_CLEAR_ENABLE"] == "ENA"

wings.util.send_cmd_and_confirm(ope, c2a_enum.Cmd_CODE_WDT_DISABLE, (), c2a_enum.Tlm_CODE_HK)
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.WDT.IS_ENABLE"] == "DIS"
assert tlm_HK["HK.WDT.IS_CLEAR_ENABLE"] == "ENA"

wings.util.send_cmd_and_confirm(ope, c2a_enum.Cmd_CODE_WDT_ENABLE, (), c2a_enum.Tlm_CODE_HK)
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.WDT.IS_ENABLE"] == "ENA"
assert tlm_HK["HK.WDT.IS_CLEAR_ENABLE"] == "ENA"

wings.util.send_cmd_and_confirm(ope, c2a_enum.Cmd_CODE_WDT_STOP_CLEAR, (), c2a_enum.Tlm_CODE_HK)
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.WDT.IS_ENABLE"] == "ENA"
assert tlm_HK["HK.WDT.IS_CLEAR_ENABLE"] == "DIS"
Expand All @@ -50,7 +50,7 @@ def test_wdt_at_sils():
ope, c2a_enum.Cmd_CODE_WDT_START_CLEAR, (), c2a_enum.Tlm_CODE_HK
)
tlm_HK = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_HK
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_HK
)
assert tlm_HK["HK.WDT.IS_ENABLE"] == "ENA"
assert tlm_HK["HK.WDT.IS_CLEAR_ENABLE"] == "ENA"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_bcl_prepare_param():
c2a_enum.Tlm_CODE_HK,
)
tlm_BL = wings.util.generate_and_receive_tlm(
ope, c2a_enum.Cmd_CODE_GENERATE_TLM, c2a_enum.Tlm_CODE_BL
ope, c2a_enum.Cmd_CODE_TG_GENERATE_MS_TLM, c2a_enum.Tlm_CODE_BL
)
assert tlm_BL["BL.BLOCK_NO"] == c2a_enum.BC_TEST_BCL

Expand Down
Loading

0 comments on commit eee7bd9

Please sign in to comment.