mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +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:
parent
182b9cb352
commit
461ab419ea
@ -263,7 +263,7 @@ AC_DEFUN([OVS_CHECK_LINUX_AF_XDP], [
|
||||
[enable_afxdp=auto])
|
||||
|
||||
AC_MSG_CHECKING([whether AF_XDP is enabled])
|
||||
if test "$enable_afxdp" == no; then
|
||||
if test "$enable_afxdp" = no; then
|
||||
AC_MSG_RESULT([no])
|
||||
AF_XDP_ENABLE=false
|
||||
else
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -131,7 +131,7 @@ EOF
|
||||
export -f as
|
||||
|
||||
sim_add() {
|
||||
if test "$1" == --help; then
|
||||
if test "$1" = --help; then
|
||||
cat <<EOF
|
||||
$FUNCNAME: create a new sandboxed Open vSwitch instance
|
||||
usage: $FUNCNAME SANDBOX
|
||||
@ -178,7 +178,7 @@ EOF
|
||||
export -f sim_add
|
||||
|
||||
net_add() {
|
||||
if test "$1" == --help; then
|
||||
if test "$1" = --help; then
|
||||
cat <<EOF
|
||||
$FUNCNAME: create a new interconnection network
|
||||
usage: $FUNCNAME NETWORK
|
||||
@ -198,7 +198,7 @@ EOF
|
||||
export -f net_add
|
||||
|
||||
net_attach() {
|
||||
if test "$1" == --help; then
|
||||
if test "$1" = --help; then
|
||||
cat <<EOF
|
||||
$FUNCNAME: attach the default sandbox to an interconnection network
|
||||
usage: $FUNCNAME NETWORK BRIDGE
|
||||
|
Loading…
x
Reference in New Issue
Block a user