From 9834c8570ce35831821c861e49b8da1f0cd528cd Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 25 Jun 2024 13:46:56 -0400 Subject: [PATCH 1/9] [nasa/nos3#176] Added test-fsw command to makefile; --- Makefile | 7 ++++++- components/sample | 2 +- fsw/psp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 95ea8b5b..84847472 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ endif # The "LOCALTGTS" defines the top-level targets that are implemented in this makefile # Any other target may also be given, in that case it will simply be passed through. -LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw +LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw test-fsw OTHERTGTS := $(filter-out $(LOCALTGTS),$(MAKECMDGOALS)) # As this makefile does not build any real files, treat everything as a PHONY target @@ -118,5 +118,10 @@ stop: stop-gsw: ./scripts/stop_gsw.sh +test-fsw: + mkdir -p $(FSWBUILDDIR) + cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe + $(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install + igniter: ./scripts/igniter_launch.sh diff --git a/components/sample b/components/sample index 34260dd8..bf8dd3df 160000 --- a/components/sample +++ b/components/sample @@ -1 +1 @@ -Subproject commit 34260dd8a8d929b6d36c8805f08754aa847d6e97 +Subproject commit bf8dd3df09d4542b8784ca6e7b91dfef646aea10 diff --git a/fsw/psp b/fsw/psp index 1159205e..cd5546b9 160000 --- a/fsw/psp +++ b/fsw/psp @@ -1 +1 @@ -Subproject commit 1159205edc17db5806ec89c6c2d97125d294c836 +Subproject commit cd5546b9b873fb50a5a7154d4072356dc6ba042e From ab4b58d11a903316bc9c5e1d97f87681c2267215 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Wed, 26 Jun 2024 14:25:51 -0400 Subject: [PATCH 2/9] [nasa/nos3#176] Building test-fsw and trying to run ctest; --- .gitignore | 3 +++ Makefile | 1 + fsw/osal | 2 +- scripts/docker_debug.sh | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0f32a7a8..f0f562f0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ build support/nos3_install.log tmp core.* +.cdskeyfile +.reservedkeyfile +.resetkeyfile diff --git a/Makefile b/Makefile index 84847472..4d106a14 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,7 @@ test-fsw: mkdir -p $(FSWBUILDDIR) cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe $(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install + cd $(FSWBUILDDIR)/amd64-linux-gnu/default_cpu1 && ctest -O ctest.log igniter: ./scripts/igniter_launch.sh diff --git a/fsw/osal b/fsw/osal index 570ad091..452824c4 160000 --- a/fsw/osal +++ b/fsw/osal @@ -1 +1 @@ -Subproject commit 570ad0913daf57ad2a62c92f6a0daef5a94f72ba +Subproject commit 452824c4fa54cf956c5ac745ea6db6773c72cc60 diff --git a/scripts/docker_debug.sh b/scripts/docker_debug.sh index 87c541a7..05f479db 100755 --- a/scripts/docker_debug.sh +++ b/scripts/docker_debug.sh @@ -9,4 +9,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh mkdir -p $BASE_DIR/fsw/build -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -w $BASE_DIR --name "nos3_debug" $DBOX bash +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash From 9c7b61b42e463a4e3beb7dbb0cf34747fb405f25 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Mon, 1 Jul 2024 14:54:39 -0400 Subject: [PATCH 3/9] [nasa/nos3#176] Created posix and nos3 toolchains and use targets.cmake to detect if building unit tests; --- Makefile | 2 +- cfg/nos3_defs/targets.cmake | 6 +++- ...x-gnu.cmake => toolchain-amd64-nos3.cmake} | 0 cfg/nos3_defs/toolchain-amd64-posix.cmake | 34 +++++++++++++++++++ fsw/apps/hwlib | 2 +- fsw/osal | 2 +- 6 files changed, 42 insertions(+), 4 deletions(-) rename cfg/nos3_defs/{toolchain-amd64-linux-gnu.cmake => toolchain-amd64-nos3.cmake} (100%) create mode 100644 cfg/nos3_defs/toolchain-amd64-posix.cmake diff --git a/Makefile b/Makefile index 4d106a14..5f85a585 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ test-fsw: mkdir -p $(FSWBUILDDIR) cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe $(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install - cd $(FSWBUILDDIR)/amd64-linux-gnu/default_cpu1 && ctest -O ctest.log + cd $(FSWBUILDDIR)/amd64-posix/default_cpu1 && ctest -O ctest.log igniter: ./scripts/igniter_launch.sh diff --git a/cfg/nos3_defs/targets.cmake b/cfg/nos3_defs/targets.cmake index b670344d..e1871f9f 100644 --- a/cfg/nos3_defs/targets.cmake +++ b/cfg/nos3_defs/targets.cmake @@ -145,7 +145,11 @@ SET(MISSION_CPUNAMES cpu1) SET(cpu1_PROCESSORID 1) SET(cpu1_APPLIST) # Note: Using all ${MISSION_GLOBAL_APPLIST} automatically SET(cpu1_FILELIST cfe_es_startup.scr) -SET(cpu1_SYSTEM amd64-linux-gnu) +if (ENABLE_UNIT_TESTS) + SET(cpu1_SYSTEM amd64-posix) +else() + SET(cpu1_SYSTEM amd64-nos3) +endif() # USER Supplied #SET(cpu2_PROCESSORID 2) diff --git a/cfg/nos3_defs/toolchain-amd64-linux-gnu.cmake b/cfg/nos3_defs/toolchain-amd64-nos3.cmake similarity index 100% rename from cfg/nos3_defs/toolchain-amd64-linux-gnu.cmake rename to cfg/nos3_defs/toolchain-amd64-nos3.cmake diff --git a/cfg/nos3_defs/toolchain-amd64-posix.cmake b/cfg/nos3_defs/toolchain-amd64-posix.cmake new file mode 100644 index 00000000..d5356637 --- /dev/null +++ b/cfg/nos3_defs/toolchain-amd64-posix.cmake @@ -0,0 +1,34 @@ +# This example toolchain file describes the cross compiler to use for +# the target architecture indicated in the configuration file. + +# Basic cross system configuration +SET(CMAKE_SYSTEM_NAME Linux) +SET(CMAKE_SYSTEM_VERSION 1) +SET(CMAKE_SYSTEM_PROCESSOR amd64) + +# Specify the cross compiler executables +# Typically these would be installed in a home directory or somewhere +# in /opt. However in this example the system compiler is used. +SET(CMAKE_C_COMPILER "/usr/bin/gcc") +SET(CMAKE_CXX_COMPILER "/usr/bin/g++") + +# Configure the find commands +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + +# These variable settings are specific to cFE/OSAL and determines which +# abstraction layers are built when using this toolchain +SET(CFE_SYSTEM_PSPNAME "pc-linux") +SET(OSAL_SYSTEM_OSTYPE "posix") + +#SET(CMAKE_C_FLAGS_INIT "" CACHE STRING "C Flags required by platform") +#SET(CMAKE_SHARED_LINKER_FLAGS "-pg") + +# Build Specific +add_definitions(-DBYTE_ORDER_LE) +add_definitions(-D_LINUX_OS_) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +set(CI_TRANSPORT udp_tf) +set(TO_TRANSPORT udp) # Note udp_tf used for Transfer Frames required for CryptoLib diff --git a/fsw/apps/hwlib b/fsw/apps/hwlib index cf82b544..f3143f23 160000 --- a/fsw/apps/hwlib +++ b/fsw/apps/hwlib @@ -1 +1 @@ -Subproject commit cf82b54413a007e79f534234733f113359660eb3 +Subproject commit f3143f23926c64a8683a89991b263f0c9b1c8aeb diff --git a/fsw/osal b/fsw/osal index 452824c4..570ad091 160000 --- a/fsw/osal +++ b/fsw/osal @@ -1 +1 @@ -Subproject commit 452824c4fa54cf956c5ac745ea6db6773c72cc60 +Subproject commit 570ad0913daf57ad2a62c92f6a0daef5a94f72ba From 350995cc26b8517503acd2c80eda0868d03715c0 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Wed, 17 Jul 2024 20:44:37 -0400 Subject: [PATCH 4/9] [nasa/nos3#176] OSAL updates from cppcheck; --- fsw/osal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsw/osal b/fsw/osal index 570ad091..31210d1f 160000 --- a/fsw/osal +++ b/fsw/osal @@ -1 +1 @@ -Subproject commit 570ad0913daf57ad2a62c92f6a0daef5a94f72ba +Subproject commit 31210d1f9b193ae201d6174b15e23c14c77b5e8a From 0b80b66c0d63f4049eb4ef5c7de0859470f53253 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 23 Jul 2024 10:32:41 -0400 Subject: [PATCH 5/9] [nasa/nos3#176] Updated CI to test-fsw, ds to resolve failing tests, and sc to comment out invalid tests as functionality disabled in NOS3; --- .github/workflows/build.yml | 2 +- fsw/apps/ds | 2 +- fsw/apps/sc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25b42f98..d0c69d1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: build directory run: mkdir ./fsw/build - name: build - run: make build-fsw + run: make test-fsw sim: runs-on: ubuntu-latest diff --git a/fsw/apps/ds b/fsw/apps/ds index 3f273f6a..1427a22c 160000 --- a/fsw/apps/ds +++ b/fsw/apps/ds @@ -1 +1 @@ -Subproject commit 3f273f6a552c1fb408b989ac0d78743452d3dbc3 +Subproject commit 1427a22cf1e419cf212193e65f6269a97d43040b diff --git a/fsw/apps/sc b/fsw/apps/sc index 37e919b7..6276cfb2 160000 --- a/fsw/apps/sc +++ b/fsw/apps/sc @@ -1 +1 @@ -Subproject commit 37e919b76b1a34fc93917d636dfc5f238de72945 +Subproject commit 6276cfb24456e68cc3da4f59517f8e52a49104de From e3c30fdff2ec631fcdfd75c78ed860b8d9c5e412 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 23 Jul 2024 10:44:11 -0400 Subject: [PATCH 6/9] [nasa/nos3#176] Revert to build-fsw instead of test-fsw in CI for now due to issues; --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0c69d1d..25b42f98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: build directory run: mkdir ./fsw/build - name: build - run: make test-fsw + run: make build-fsw sim: runs-on: ubuntu-latest From e253e9c03cb4e05b7dbe4ee0ff93346a5c2b2171 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Wed, 31 Jul 2024 14:35:59 -0400 Subject: [PATCH 7/9] [nasa/nos3#176] Added hwlib stubs to CMakeLists for unit-tests, resolved errors in current tests, added build-test command to iterate faster on specific tests; --- Makefile | 10 ++++++---- components/sample | 2 +- fsw/apps/hwlib | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5f85a585..b7c8c3bf 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ endif # The "LOCALTGTS" defines the top-level targets that are implemented in this makefile # Any other target may also be given, in that case it will simply be passed through. -LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw test-fsw +LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw OTHERTGTS := $(filter-out $(LOCALTGTS),$(MAKECMDGOALS)) # As this makefile does not build any real files, treat everything as a PHONY target @@ -61,6 +61,11 @@ build-sim: cd $(SIMBUILDDIR) && cmake -DCMAKE_INSTALL_PREFIX=$(SIMBUILDDIR) .. $(MAKE) --no-print-directory -C $(SIMBUILDDIR) install +build-test: + mkdir -p $(FSWBUILDDIR) + cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe + $(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install + checkout: ./scripts/docker_checkout.sh @@ -119,9 +124,6 @@ stop-gsw: ./scripts/stop_gsw.sh test-fsw: - mkdir -p $(FSWBUILDDIR) - cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe - $(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install cd $(FSWBUILDDIR)/amd64-posix/default_cpu1 && ctest -O ctest.log igniter: diff --git a/components/sample b/components/sample index bf8dd3df..75e69a93 160000 --- a/components/sample +++ b/components/sample @@ -1 +1 @@ -Subproject commit bf8dd3df09d4542b8784ca6e7b91dfef646aea10 +Subproject commit 75e69a935ebc69fe0543dcce0fa82a792c4401f9 diff --git a/fsw/apps/hwlib b/fsw/apps/hwlib index f3143f23..f2e180cc 160000 --- a/fsw/apps/hwlib +++ b/fsw/apps/hwlib @@ -1 +1 @@ -Subproject commit f3143f23926c64a8683a89991b263f0c9b1c8aeb +Subproject commit f2e180cc30a883660ec70a3fb5391f4eb86a2f29 From 6c8d59a64a864d3ff9464a2c06639d3075eeac12 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Fri, 2 Aug 2024 07:07:05 -0400 Subject: [PATCH 8/9] [nasa/nos3#176] Resolved issue with Test_SAMPLE_ProcessCommandPacket; --- components/sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/sample b/components/sample index 75e69a93..51c88a38 160000 --- a/components/sample +++ b/components/sample @@ -1 +1 @@ -Subproject commit 75e69a935ebc69fe0543dcce0fa82a792c4401f9 +Subproject commit 51c88a38f8c20a97392c5de0579e30744e79dec7 From 354cbcda540ca2bf6e73a327fb1c85ced8a86c2f Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 6 Aug 2024 17:17:06 -0400 Subject: [PATCH 9/9] [nasa/nos3#176] Updates after submodule merges; --- components/sample | 2 +- fsw/apps/ds | 2 +- fsw/apps/hwlib | 2 +- fsw/apps/sc | 2 +- fsw/osal | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/sample b/components/sample index 51c88a38..7845664c 160000 --- a/components/sample +++ b/components/sample @@ -1 +1 @@ -Subproject commit 51c88a38f8c20a97392c5de0579e30744e79dec7 +Subproject commit 7845664c3ed42e4aa83d04fae1b507099ae21b55 diff --git a/fsw/apps/ds b/fsw/apps/ds index 1427a22c..d17e750b 160000 --- a/fsw/apps/ds +++ b/fsw/apps/ds @@ -1 +1 @@ -Subproject commit 1427a22cf1e419cf212193e65f6269a97d43040b +Subproject commit d17e750bec8ec9a2cfbcd32f5633dafaf919bc40 diff --git a/fsw/apps/hwlib b/fsw/apps/hwlib index f2e180cc..9c4dc2a1 160000 --- a/fsw/apps/hwlib +++ b/fsw/apps/hwlib @@ -1 +1 @@ -Subproject commit f2e180cc30a883660ec70a3fb5391f4eb86a2f29 +Subproject commit 9c4dc2a169f220c515629e5e8cc1a60929605035 diff --git a/fsw/apps/sc b/fsw/apps/sc index 6276cfb2..bb3e6945 160000 --- a/fsw/apps/sc +++ b/fsw/apps/sc @@ -1 +1 @@ -Subproject commit 6276cfb24456e68cc3da4f59517f8e52a49104de +Subproject commit bb3e6945830b7e6cd7a3d25fa00969ac2c4f7be6 diff --git a/fsw/osal b/fsw/osal index 31210d1f..9c9b9f6d 160000 --- a/fsw/osal +++ b/fsw/osal @@ -1 +1 @@ -Subproject commit 31210d1f9b193ae201d6174b15e23c14c77b5e8a +Subproject commit 9c9b9f6dd75b7b3adaf9021040db3d112ef709e5