From 839077de57fa1448f0a985d4f50576787f77fb91 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 13 Mar 2025 14:32:08 +0100 Subject: [PATCH] test: Corrected and documents -v vs -V transaction testing --- example/main/example_backend.c | 2 +- example/main/example_backend_nacm.c | 1 + test/test_transaction.sh | 4 ++-- test/test_transaction_startup.sh | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/example/main/example_backend.c b/example/main/example_backend.c index 98c76f1c..319cf028 100644 --- a/example/main/example_backend.c +++ b/example/main/example_backend.c @@ -49,7 +49,7 @@ * -U general-purpose upgrade * -t enable transaction logging (call syslog for every transaction) * -V Failing validate and commit if is present (synthetic error) - + * Note example_backend uses -v */ #include #include diff --git a/example/main/example_backend_nacm.c b/example/main/example_backend_nacm.c index 77c1f5bd..92aed2d4 100644 --- a/example/main/example_backend_nacm.c +++ b/example/main/example_backend_nacm.c @@ -39,6 +39,7 @@ * - transaction test * -t enable transaction logging (call syslog for every transaction) * -v Failing validate and commit if is present (synthetic error) + * Note example_backend uses -V */ #include #include diff --git a/test/test_transaction.sh b/test/test_transaction.sh index 09bafe2c..7837a424 100755 --- a/test/test_transaction.sh +++ b/test/test_transaction.sh @@ -152,8 +152,8 @@ if [ $BE -ne 0 ]; then if [ $? -ne 0 ]; then err fi - new "start backend -s init -f $cfg -l f$flog -- -t -V \"/x/y[a='$errnr']\"" - start_backend -s init -f $cfg -l f$flog -- -t -V "/x/y[a='$errnr']" # -t means transaction logging + new "start backend -s init -f $cfg -l f$flog -- -t -v \"/x/y[a='$errnr']\"" + start_backend -s init -f $cfg -l f$flog -- -t -v "/x/y[a='$errnr']" # -t means transaction logging fi new "wait backend" diff --git a/test/test_transaction_startup.sh b/test/test_transaction_startup.sh index 2a21830b..8d37e177 100755 --- a/test/test_transaction_startup.sh +++ b/test/test_transaction_startup.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Transaction functionality: Start from startup and ensure +# Transaction functionality: Start from startup and ensure # first transaction is OK including diff # See eg https://github.com/clicon/clixon/issues/596 @@ -72,7 +72,7 @@ function checklog(){ t=$(grep -n "transaction_log $s" $flog) if [ -z "$t" ]; then echo -e "\e[31m\nError in Test$testnr [$testname]:" - if [ $# -gt 0 ]; then + if [ $# -gt 0 ]; then echo "Not found \"$s\" on line $l0" echo fi @@ -82,7 +82,7 @@ function checklog(){ l1=$(echo "$t" | awk -F ":" '{print $1}') if [ $l1 -ne $l0 ]; then echo -e "\e[31m\nError in Test$testnr [$testname]:" - if [ $# -gt 0 ]; then + if [ $# -gt 0 ]; then echo "Expected match on line $l0, found on $l1" echo fi