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
Linux CommandExecutor
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
371ff931bf
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
Merge remote-tracking branch 'upstream/development' into mueller/cmd-executor
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
74ae3f1371
muellerr added 1 commit 2022-02-01 13:47:55 +01:00
update dockerfile
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
990e8672a8
muellerr added 1 commit 2022-02-01 13:57:35 +01:00
test
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
d2b561ba2f
muellerr added 1 commit 2022-02-01 14:04:22 +01:00
move strcmp outside of macro
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
368481f88b
muellerr added 1 commit 2022-02-01 18:04:42 +01:00
valgrind why
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
acbc2cd749
muellerr added 2 commits 2022-02-02 09:56:46 +01:00
muellerr added 1 commit 2022-02-02 10:01:11 +01:00
it actually was an uninitialized array
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
e0c50477cb
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.