Skip to content

Commit

Permalink
Merge pull request #40 from Ali-aqrabawi/fix_test_false_success
Browse files Browse the repository at this point in the history
test: fix run test false success
  • Loading branch information
Ali-aqrabawi authored Mar 6, 2024
2 parents 33ce623 + ddd402a commit 348c2bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/actions-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: add missing packages
uses: ConorMacBride/install-package@v1
with:
apt: libelf-dev libbpf-dev libbsd-dev libcap-dev libmnl-dev libselinux-dev clang-format
apt: libelf-dev libbpf-dev libbsd-dev libcap-dev libmnl-dev libselinux-dev clang-format linux-modules-extra-$(uname -r)
- name: libyang v2.1.148 from upstream
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -47,6 +47,8 @@ jobs:
run : CC=${{ matrix.compiler }} make -j $(nproc)
- name: basic compilation check
run : ldd bin/iproute2-sysrepo
- name: install required kernel mod(s)
run : sudo modprobe vrf bonding
- name: basic test "ip link add/set"
run : |
set -e
Expand Down
5 changes: 5 additions & 0 deletions src/lib/cmdgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ char *lyd2cmdline_args(const struct lyd_node *startcmd_node, oper_t op_val)
switch (next->schema->nodetype) {
case LYS_LIST:
case LYS_CONTAINER:
// if this and empty "when all container" skip.
// if when condition added, the continer will be included in the lyd tree even if
// no data inside the container, container will have LYD_DEFAULT|LYD_WHEN_TRUE flags
if ((next->flags & LYD_DEFAULT) && (next->flags & LYD_WHEN_TRUE))
break;
if (get_extension(ADD_STATIC_ARG, next, &add_static_arg) == EXIT_SUCCESS) {
if (add_static_arg == NULL) {
fprintf(stderr,
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ for test_script in tests/cases/*.sh; do
echo "Error: $test_script failed with exit code $script_ret"
kill $sysrepo_pid
wait $sysrepo_pid
exit $ret
exit $script_ret
fi
echo "Completed $test_script"
fi
Expand Down

0 comments on commit 348c2bf

Please sign in to comment.