summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2023-01-05 15:12:29 +0100
committerIlya Maximets <i.maximets@ovn.org>2023-01-06 15:56:12 +0100
commit461ab419ead100ef38a3f596151e826ca3dd131d (patch)
tree7c7af8f818cf9bc9b97190c3cda522340f0f860e /tests
parent182b9cb3524c5e7be20be7ebf061c6730a7f7e26 (diff)
downloadopenvswitch-461ab419ead100ef38a3f596151e826ca3dd131d.tar.gz
treewide: Don't use non-portable '==' with test command.
'==' is not defined by POSIX and not supported by some shells. This is causing test failures and potential other issues: ./tests/testsuite: 54: test: X2: unexpected operator ./tests/testsuite: 54: test: X157: unexpected operator ./tests/testsuite: 54: test: X116: unexpected operator Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-December/052157.html Reviewed-by: David Marchand <david.marchand@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/ovsdb-cluster.at14
-rw-r--r--tests/ovsdb-server.at2
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/ovsdb-cluster.at b/tests/ovsdb-cluster.at
index 920b833b7..9fbf5dc89 100644
--- a/tests/ovsdb-cluster.at
+++ b/tests/ovsdb-cluster.at
@@ -8,7 +8,7 @@ ovsdb_check_cluster () {
$schema_func > schema
schema=`ovsdb-tool schema-name schema`
AT_CHECK([ovsdb-tool '-vPATTERN:console:%c|%p|%m' create-cluster s1.db schema unix:s1.raft], [0], [], [stderr])
- if test X$local_config == X"yes"; then
+ if test X$local_config = X"yes"; then
for i in `seq $n`; do
AT_CHECK([ovsdb-tool create c$i.db $top_srcdir/ovsdb/local-config.ovsschema], [0], [], [stderr])
local ctxn="[[\"Local_Config\",
@@ -30,7 +30,7 @@ ovsdb_check_cluster () {
for i in `seq $n`; do
local remote=punix:s$i.ovsdb
local config_db=
- if test X$local_config == X"yes"; then
+ if test X$local_config = X"yes"; then
remote=db:Local_Config,Config,connections
config_db=c$i.db
fi
@@ -129,7 +129,7 @@ ovsdb_test_cluster_disconnect () {
# When a node is disconnected from the cluster, the IDL should disconnect
# and retry even if it uses a single remote, because the remote IP can be
# a VIP on a load-balance. So we use single remote to test here.
- if test $leader_or_follower == "leader"; then
+ if test $leader_or_follower = "leader"; then
target=1
shutdown=`seq $(($n/2 + 1)) $n`
cleanup=`seq $(($n/2))`
@@ -188,13 +188,13 @@ ovsdb_test_cluster_disconnect () {
count_old=`grep "raft_is_connected: true" raft_is_connected.log | wc -l`
echo count_old $count_old
- if test X$check_flapping == X"yes"; then
+ if test X$check_flapping = X"yes"; then
sleep 10
fi
# Make sure raft_is_connected didn't flap from false to true.
count_new=`grep "raft_is_connected: true" raft_is_connected.log | wc -l`
echo count_new $count_new
- AT_CHECK([test $count_new == $count_old])
+ AT_CHECK([test $count_new = $count_old])
for i in $cleanup; do
OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/s$i], [s$i.pid])
@@ -493,7 +493,7 @@ ovsdb_cluster_failure_test () {
remote_2=$2
crash_node=$3
crash_command=$4
- if test "$crash_node" == "1"; then
+ if test "$crash_node" = "1"; then
new_leader=$5
fi
log_grep=$6
@@ -536,7 +536,7 @@ ovsdb_cluster_failure_test () {
# To ensure $new_leader node the new leader, we delay election timer for
# the other follower.
if test -n "$new_leader"; then
- if test "$new_leader" == "2"; then
+ if test "$new_leader" = "2"; then
delay_election_node=3
else
delay_election_node=2
diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at
index c7b2fe3ae..0828e6d04 100644
--- a/tests/ovsdb-server.at
+++ b/tests/ovsdb-server.at
@@ -1270,7 +1270,7 @@ dnl a case where there is only one transaction in a history.
get_memory_value () {
n=$(ovs-appctl -t ovsdb-server memory/show dnl
| tr ' ' '\n' | grep "^$1:" | cut -d ':' -f 2)
- if test X"$n" == "X"; then
+ if test X"$n" = "X"; then
n=0
fi
echo $n