mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
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>
This commit is contained in:
@@ -263,7 +263,7 @@ AC_DEFUN([OVS_CHECK_LINUX_AF_XDP], [
|
|||||||
[enable_afxdp=auto])
|
[enable_afxdp=auto])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether AF_XDP is enabled])
|
AC_MSG_CHECKING([whether AF_XDP is enabled])
|
||||||
if test "$enable_afxdp" == no; then
|
if test "$enable_afxdp" = no; then
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
AF_XDP_ENABLE=false
|
AF_XDP_ENABLE=false
|
||||||
else
|
else
|
||||||
|
@@ -8,7 +8,7 @@ ovsdb_check_cluster () {
|
|||||||
$schema_func > schema
|
$schema_func > schema
|
||||||
schema=`ovsdb-tool schema-name 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])
|
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
|
for i in `seq $n`; do
|
||||||
AT_CHECK([ovsdb-tool create c$i.db $top_srcdir/ovsdb/local-config.ovsschema], [0], [], [stderr])
|
AT_CHECK([ovsdb-tool create c$i.db $top_srcdir/ovsdb/local-config.ovsschema], [0], [], [stderr])
|
||||||
local ctxn="[[\"Local_Config\",
|
local ctxn="[[\"Local_Config\",
|
||||||
@@ -30,7 +30,7 @@ ovsdb_check_cluster () {
|
|||||||
for i in `seq $n`; do
|
for i in `seq $n`; do
|
||||||
local remote=punix:s$i.ovsdb
|
local remote=punix:s$i.ovsdb
|
||||||
local config_db=
|
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
|
remote=db:Local_Config,Config,connections
|
||||||
config_db=c$i.db
|
config_db=c$i.db
|
||||||
fi
|
fi
|
||||||
@@ -129,7 +129,7 @@ ovsdb_test_cluster_disconnect () {
|
|||||||
# When a node is disconnected from the cluster, the IDL should 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
|
# 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.
|
# 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
|
target=1
|
||||||
shutdown=`seq $(($n/2 + 1)) $n`
|
shutdown=`seq $(($n/2 + 1)) $n`
|
||||||
cleanup=`seq $(($n/2))`
|
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`
|
count_old=`grep "raft_is_connected: true" raft_is_connected.log | wc -l`
|
||||||
echo count_old $count_old
|
echo count_old $count_old
|
||||||
|
|
||||||
if test X$check_flapping == X"yes"; then
|
if test X$check_flapping = X"yes"; then
|
||||||
sleep 10
|
sleep 10
|
||||||
fi
|
fi
|
||||||
# Make sure raft_is_connected didn't flap from false to true.
|
# 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`
|
count_new=`grep "raft_is_connected: true" raft_is_connected.log | wc -l`
|
||||||
echo count_new $count_new
|
echo count_new $count_new
|
||||||
AT_CHECK([test $count_new == $count_old])
|
AT_CHECK([test $count_new = $count_old])
|
||||||
|
|
||||||
for i in $cleanup; do
|
for i in $cleanup; do
|
||||||
OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/s$i], [s$i.pid])
|
OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/s$i], [s$i.pid])
|
||||||
@@ -493,7 +493,7 @@ ovsdb_cluster_failure_test () {
|
|||||||
remote_2=$2
|
remote_2=$2
|
||||||
crash_node=$3
|
crash_node=$3
|
||||||
crash_command=$4
|
crash_command=$4
|
||||||
if test "$crash_node" == "1"; then
|
if test "$crash_node" = "1"; then
|
||||||
new_leader=$5
|
new_leader=$5
|
||||||
fi
|
fi
|
||||||
log_grep=$6
|
log_grep=$6
|
||||||
@@ -536,7 +536,7 @@ ovsdb_cluster_failure_test () {
|
|||||||
# To ensure $new_leader node the new leader, we delay election timer for
|
# To ensure $new_leader node the new leader, we delay election timer for
|
||||||
# the other follower.
|
# the other follower.
|
||||||
if test -n "$new_leader"; then
|
if test -n "$new_leader"; then
|
||||||
if test "$new_leader" == "2"; then
|
if test "$new_leader" = "2"; then
|
||||||
delay_election_node=3
|
delay_election_node=3
|
||||||
else
|
else
|
||||||
delay_election_node=2
|
delay_election_node=2
|
||||||
|
@@ -1270,7 +1270,7 @@ dnl a case where there is only one transaction in a history.
|
|||||||
get_memory_value () {
|
get_memory_value () {
|
||||||
n=$(ovs-appctl -t ovsdb-server memory/show dnl
|
n=$(ovs-appctl -t ovsdb-server memory/show dnl
|
||||||
| tr ' ' '\n' | grep "^$1:" | cut -d ':' -f 2)
|
| tr ' ' '\n' | grep "^$1:" | cut -d ':' -f 2)
|
||||||
if test X"$n" == "X"; then
|
if test X"$n" = "X"; then
|
||||||
n=0
|
n=0
|
||||||
fi
|
fi
|
||||||
echo $n
|
echo $n
|
||||||
|
@@ -131,7 +131,7 @@ EOF
|
|||||||
export -f as
|
export -f as
|
||||||
|
|
||||||
sim_add() {
|
sim_add() {
|
||||||
if test "$1" == --help; then
|
if test "$1" = --help; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
$FUNCNAME: create a new sandboxed Open vSwitch instance
|
$FUNCNAME: create a new sandboxed Open vSwitch instance
|
||||||
usage: $FUNCNAME SANDBOX
|
usage: $FUNCNAME SANDBOX
|
||||||
@@ -178,7 +178,7 @@ EOF
|
|||||||
export -f sim_add
|
export -f sim_add
|
||||||
|
|
||||||
net_add() {
|
net_add() {
|
||||||
if test "$1" == --help; then
|
if test "$1" = --help; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
$FUNCNAME: create a new interconnection network
|
$FUNCNAME: create a new interconnection network
|
||||||
usage: $FUNCNAME NETWORK
|
usage: $FUNCNAME NETWORK
|
||||||
@@ -198,7 +198,7 @@ EOF
|
|||||||
export -f net_add
|
export -f net_add
|
||||||
|
|
||||||
net_attach() {
|
net_attach() {
|
||||||
if test "$1" == --help; then
|
if test "$1" = --help; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
$FUNCNAME: attach the default sandbox to an interconnection network
|
$FUNCNAME: attach the default sandbox to an interconnection network
|
||||||
usage: $FUNCNAME NETWORK BRIDGE
|
usage: $FUNCNAME NETWORK BRIDGE
|
||||||
|
Reference in New Issue
Block a user