Skip to content

Commit

Permalink
fix(build): In ci.sh use sudo for valgrind instead of set_capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Oct 8, 2023
1 parent 2f80ccb commit 70a206b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ jobs:
run: source tools/ci.sh && ${{matrix.cmd_action}}
env:
ETHERNET_INTERFACE: eth0
SKIP_ETHERNET: true
3 changes: 3 additions & 0 deletions tests/pubsub/check_pubsub_connection_ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ START_TEST(GetMaximalConnectionConfigurationAndCompareValues){
} END_TEST

int main(void) {
if(SKIP_ETHERNET && strlen(SKIP_ETHERNET) > 0)
return EXIT_SUCCESS;

TCase *tc_add_pubsub_connections_minimal_config = tcase_create("Create PubSub Ethernet Connections with minimal valid config");
tcase_add_checked_fixture(tc_add_pubsub_connections_minimal_config, setup, teardown);
tcase_add_test(tc_add_pubsub_connections_minimal_config, AddConnectionsWithMinimalValidConfiguration);
Expand Down
3 changes: 3 additions & 0 deletions tests/pubsub/check_pubsub_connection_ethernet_etf.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ START_TEST(GetMaximalConnectionConfigurationAndCompareValues){
} END_TEST

int main(void) {
if(SKIP_ETHERNET && strlen(SKIP_ETHERNET) > 0)
return EXIT_SUCCESS;

TCase *tc_add_pubsub_connections_minimal_config = tcase_create("Create PubSub Ethernet ETF Connections with minimal valid config");
tcase_add_checked_fixture(tc_add_pubsub_connections_minimal_config, setup, teardown);
tcase_add_test(tc_add_pubsub_connections_minimal_config, AddConnectionsWithMinimalValidConfiguration);
Expand Down
3 changes: 3 additions & 0 deletions tests/pubsub/check_pubsub_publish_ethernet_etf.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ START_TEST(EthernetSendWithVLANTag) {
} END_TEST

int main(void) {
if(SKIP_ETHERNET && strlen(SKIP_ETHERNET) > 0)
return EXIT_SUCCESS;

/*Test case to run both publisher*/
TCase *tc_pubsub_ethernet_etf_publish = tcase_create("Publisher publishing Ethernet packets based on etf");
tcase_add_checked_fixture(tc_pubsub_ethernet_etf_publish, setup, teardown);
Expand Down
1 change: 1 addition & 0 deletions tests/pubsub/ethernet_config.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#define ETHERNET_INTERFACE getenv("ETHERNET_INTERFACE")
#define SKIP_ETHERNET getenv("SKIP_ETHERNET")
#define MULTICAST_MAC_ADDRESS "opc.eth://08-00-27-b9-65-4a"
7 changes: 4 additions & 3 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function unit_tests_pubsub_sks {
-DUA_FORCE_WERROR=ON \
..
make ${MAKEOPTS}
# set_capabilities not possible with valgrind
set_capabilities
make test ARGS="-V -R sks"
}

Expand Down Expand Up @@ -347,7 +347,7 @@ function unit_tests_valgrind {
..
make ${MAKEOPTS}
# set_capabilities not possible with valgrind
make test ARGS="-V"
sudo bash -c "make test ARGS=\"-V\""
}

########################################
Expand Down Expand Up @@ -388,7 +388,8 @@ function examples_valgrind {
# Run each example with valgrind. Wait 10 seconds and send the SIGINT
# signal. Wait for the process to terminate and collect the exit status.
# Abort when the exit status is non-null.
python3 ../tools/examples_with_valgrind.py
# set_capabilities not possible with valgrind
sudo bash -c "python3 ../tools/examples_with_valgrind.py"
EXIT_CODE=$?
if [[ $EXIT_CODE -ne 0 ]]; then
echo "Processing failed with exit code $EXIT_CODE"
Expand Down

0 comments on commit 70a206b

Please sign in to comment.