Linux CommandExecutor #536

Merged
muellerr merged 9 commits from eive/fsfw:mueller/cmd-executor into development 2022-02-02 10:17:52 +01:00
Owner

The CommandExecutor helper class can execute shell commands in blocking and non-blocking mode
This class is able to execute processes by using the Linux popen call. It also has the capability of writing
the read output of a process into a provided ring buffer.

The executor works by first loading the command which should be executed and specifying whether
it should be executed blocking or non-blocking. After that, execution can be started with the execute call.

Using non-blocking mode allows to execute commands which might take a longer time in the background,
and allowing the user thread to check completion status with the check function

Moved to HAL like requested in code review and unit tested with failing commands as well.
Also, Linux HAL components are compiled by default now unless explicitely disabled.

The CommandExecutor helper class can execute shell commands in blocking and non-blocking mode This class is able to execute processes by using the Linux `popen` call. It also has the capability of writing the read output of a process into a provided ring buffer. The executor works by first loading the command which should be executed and specifying whether it should be executed blocking or non-blocking. After that, execution can be started with the execute call. Using non-blocking mode allows to execute commands which might take a longer time in the background, and allowing the user thread to check completion status with the check function Moved to HAL like requested in code review and unit tested with failing commands as well. Also, Linux HAL components are compiled by default now unless explicitely disabled.
muellerr added 1 commit 2022-01-26 12:15:23 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
371ff931bf
Linux CommandExecutor
The CommandExecutor helper class can execute shell commands in blocking and non-blocking mode
This class is able to execute processes by using the Linux popen call. It also has the capability of writing
the read output of a process into a provided ring buffer.

The executor works by first loading the command which should be executed and specifying whether
it should be executed blocking or non-blocking. After that, execution can be started with the execute call.

Using non-blocking mode allows to execute commands which might take a longer time in the background,
and allowing the user thread to check completion status with the check function

Moved to HAL like requested in code review and unit tested with failing commands as well.
Also, Linux HAL components are compiled by default now unless explicitely disabled.
muellerr requested review from gaisser 2022-01-26 12:15:33 +01:00
muellerr added this to the v4.0.0 milestone 2022-01-26 12:15:36 +01:00
Owner

depends on #538

depends on #538
Owner

Because of trust issues, Jenkins is using the updated Kenkinsfile from master as implemented in #538.

That means the CI Run now is valid and failed because of a failed unit test.

Because of trust issues, Jenkins is using the updated Kenkinsfile from master as implemented in #538. That means the CI Run now is valid and failed because of a failed unit test.
mohr reviewed 2022-01-31 15:35:12 +01:00
@ -0,0 +72,4 @@
result = cmdExecutor.check(bytesHaveBeenRead);
REQUIRE(result != CommandExecutor::COMMAND_ERROR);
usleep(500);
REQUIRE(limitIdx < 20);
Owner

Catch2 says

FAILED:
  REQUIRE( limitIdx < 20 )
with expansion:
  20 < 20
Catch2 says ``` FAILED: REQUIRE( limitIdx < 20 ) with expansion: 20 < 20 ```
Author
Owner

"but it works on my machine". All jokes aside, a test which can depend on how fast a particular system is or how it handles separate threads is not ideal. I can just increase the limit for now. This is just a safety mechanism to prevent hang-ups

"but it works on my machine". All jokes aside, a test which can depend on how fast a particular system is or how it handles separate threads is not ideal. I can just increase the limit for now. This is just a safety mechanism to prevent hang-ups
Author
Owner

Okay, this is because ping is not installed in the container.

Okay, this is because `ping` is not installed in the container.
muellerr added 1 commit 2022-02-01 10:49:44 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
74ae3f1371
Merge remote-tracking branch 'upstream/development' into mueller/cmd-executor
muellerr added 1 commit 2022-02-01 13:47:55 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
990e8672a8
update dockerfile
muellerr added 1 commit 2022-02-01 13:57:35 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
d2b561ba2f
test
muellerr added 1 commit 2022-02-01 14:04:22 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
368481f88b
move strcmp outside of macro
muellerr added 1 commit 2022-02-01 18:04:42 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
acbc2cd749
valgrind why
muellerr added 2 commits 2022-02-02 09:56:46 +01:00
muellerr added 1 commit 2022-02-02 10:01:11 +01:00
fsfw/fsfw/pipeline/pr-development This commit looks good Details
e0c50477cb
it actually was an uninitialized array
muellerr merged commit 98dbaf03e0 into development 2022-02-02 10:17:52 +01:00
muellerr deleted branch mueller/cmd-executor 2022-02-02 10:17:56 +01:00
Sign in to join this conversation.
No description provided.