generated from ut-issl/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #386 from ut-issl/feature/add_test_for_comm_with_c2a
Pre Release (v3.7.0-beta.0): C2A間通信のテストを追加
- Loading branch information
Showing
29 changed files
with
868 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
42 changes: 42 additions & 0 deletions
42
Examples/2nd_obc_user/src/src_user/Settings/TlmCmd/DataBase/CMDFILE/sample.ops
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.# ************************************* # | ||
# = Sample Command File = # | ||
# ************************************* # | ||
.# MOBC と 2nd OBC (AOBC) のサンプル | ||
.# | ||
.# ======================================= | ||
# NOP | ||
# ======================================= | ||
.MOBC_RT.Cmd_NOP | ||
.AOBC_RT.Cmd_NOP | ||
.# | ||
.# ======================================= | ||
# HK の生成 | ||
# AOBC > MOBC に AOBC HK が定期送信されている前提 | ||
# ======================================= | ||
.MOBC_RT.Cmd_BCT_CLEAR_BLOCK 77 # BCT 77 を使用 | ||
wait_sec 1 | ||
MOBC_BL.Cmd_GENERATE_TLM 1 0x40 0xf0 1 # HK | ||
wait_sec 1 | ||
MOBC_BL.Cmd_GENERATE_TLM 3 0x40 0x91 1 # AOBC HK | ||
wait_sec 1 | ||
MOBC_BL.Cmd_TLCD_DEPLOY_BLOCK 10 2 77 | ||
wait_sec 1 | ||
MOBC_RT.Cmd_BCE_ACTIVATE_BLOCK | ||
wait_sec 1 | ||
MOBC_RT.Cmd_TLCD_CLEAR_ALL_TIMELINE 2 | ||
wait_sec 1 | ||
# BCを展開し,TLM出力開始 | ||
MOBC_RT.Cmd_TLCD_DEPLOY_BLOCK 2 77 | ||
.# | ||
.# ======================================= | ||
# AOBC Tlm | ||
# ======================================= | ||
.MOBC_RT.Cmd_GENERATE_TLM 0x40 0x90 1 # AOBC AOBC → CNT ERR が出るはず | ||
.AOBC_RT.Cmd_GENERATE_TLM 0x40 0x90 1 # AOBC AOBC | ||
.MOBC_RT.Cmd_GENERATE_TLM 0x40 0x90 1 # AOBC AOBC | ||
.# | ||
.# AOBCリセット | ||
.MOBC_RT.Cmd_AM_INITIALIZE_APP 4 # AR_DI_AOBC | ||
.MOBC_RT.Cmd_GENERATE_TLM 0x40 0x90 1 # AOBC AOBC → CNT ERR が出るはず | ||
.AOBC_RT.Cmd_GENERATE_TLM 0x40 0x90 1 # AOBC AOBC | ||
.MOBC_RT.Cmd_GENERATE_TLM 0x40 0x90 1 # AOBC AOBC |
2 changes: 1 addition & 1 deletion
2
...s/2nd_obc_user/src/src_user/Settings/TlmCmd/DataBase/CMD_DB/SAMPLE_AOBC_CMD_DB_CMD_DB.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 26 additions & 26 deletions
52
.../2nd_obc_user/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/SAMPLE_AOBC_TLM_DB_AOBC_HK.csv
Large diffs are not rendered by default.
Oops, something went wrong.
242 changes: 121 additions & 121 deletions
242
...r/src/src_user/Settings/TlmCmd/DataBase/TLM_DB/calced_data/SAMPLE_AOBC_TLM_DB_AOBC_HK.csv
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# C2A PYTEST (C2A 間通信用) | ||
- C2A におけるテスト一般については, [Examples/minimum_user/src/src_user/Test](../../../../minimum_user/src/src_user/Test) を参照すること. | ||
- ここでは, `minimum_user` (MOBC に相当)と `2nd_obc_user` (非 MOBC に相当.ここでは AOBC とする)を用いた C2A 間通信のテストについて記載する. | ||
|
||
## テスト用 SILS 構成 | ||
- WINGS に, MOBC と AOBC の両方の TlmCmd DB を登録する. | ||
- WINGS の使い方は WINGS Document を参照すること. | ||
- SILS 環境 [S2E User for C2A Core](https://github.com/ut-issl/s2e-user-for-c2a-core) を 2 セット準備し, MOBC,AOBC それぞれを立ち上げる. | ||
- S2E の使い方は S2E Document を参照すること. | ||
- この時, MOBC の CCSDS ポートは WINGS の仮想ポートに接続(ループバック)し, MOBC の UART ポートは AOBC の UART ポートに接続(ループバック)させる. | ||
- MOBC 側で AOBC への COM ポートへの出力を有効化するために,以下を ON にする. | ||
- https://github.com/ut-issl/c2a-core/blob/2d9af4736342f6aebc004db9fbf9fc2887829e8b/Examples/minimum_user/CMakeLists.txt#L17 | ||
- デフォルトでは,以下のようになっている. | ||
- MOBC CCSDS: COM11 | ||
- MOBC UART: COM13 | ||
- AOBC UART: COM14 | ||
- テストを実行する. |
7 changes: 7 additions & 0 deletions
7
Examples/2nd_obc_user/src/src_user/Test/authorization.json.temp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"client_id": "hoge_id", | ||
"client_secret": "hoge_secret", | ||
"grant_type": "hoge", | ||
"username": "hoge@fuga", | ||
"password": "piyopiyo" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[pytest] | ||
markers = | ||
real | ||
sils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"c2a_src_rel_path": "/../../", | ||
"mobc_c2a_src_rel_path": "/../../../../minimum_user/src" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
import sys | ||
import time | ||
import pytest | ||
|
||
ROOT_PATH = "../" | ||
sys.path.append(os.path.dirname(__file__) + "/" + ROOT_PATH + "utils") | ||
import c2a_enum_utils | ||
import wings_utils | ||
|
||
c2a_enum = c2a_enum_utils.get_c2a_enum() | ||
mobc_c2a_enum = c2a_enum_utils.get_mobc_c2a_enum() | ||
ope = wings_utils.get_wings_operation() | ||
|
||
|
||
@pytest.fixture(scope="session", autouse=True) | ||
def increase_hk_frequency(): | ||
_increase_hk_frequency() | ||
yield | ||
|
||
|
||
def _increase_hk_frequency(): | ||
|
||
ope.send_rt_cmd( | ||
mobc_c2a_enum.Cmd_CODE_TLCD_CLEAR_ALL_TIMELINE, | ||
(2,), | ||
) | ||
time.sleep(0.1) | ||
|
||
ope.send_rt_cmd( | ||
mobc_c2a_enum.Cmd_CODE_BCT_CLEAR_BLOCK, | ||
(mobc_c2a_enum.BC_HK_CYCLIC_TLM,), | ||
) | ||
time.sleep(0.1) | ||
|
||
for ti in range(1, 10, 2): | ||
ope.send_bl_cmd( | ||
ti, | ||
mobc_c2a_enum.Cmd_CODE_GENERATE_TLM, | ||
(0x40, mobc_c2a_enum.Tlm_CODE_HK, 1), | ||
) | ||
time.sleep(0.1) | ||
|
||
ope.send_bl_cmd( | ||
10, | ||
mobc_c2a_enum.Cmd_CODE_TLCD_DEPLOY_BLOCK, | ||
(2, mobc_c2a_enum.BC_HK_CYCLIC_TLM), | ||
) | ||
time.sleep(0.1) | ||
|
||
ope.send_rt_cmd(mobc_c2a_enum.Cmd_CODE_BCE_ACTIVATE_BLOCK, ()) | ||
time.sleep(0.1) | ||
|
||
ope.send_rt_cmd( | ||
mobc_c2a_enum.Cmd_CODE_TLCD_DEPLOY_BLOCK, | ||
(2, mobc_c2a_enum.BC_HK_CYCLIC_TLM), | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
_increase_hk_frequency() |
Oops, something went wrong.