Skip to contentSkip to conversation

tests: Remove bashisms (s/source/.)

PATCH In review Petr Vorel 4 participants 5 messages Oct 8, 2017 – Oct 15, 2017

Subsystems (2)
lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 tests: Remove bashisms (s/source/.)

---
 testsuite/tests/ip/link/new_link.t            | 2 +-
 testsuite/tests/ip/link/show_dev_wo_vf_rate.t | 2 +-
 testsuite/tests/ip/netns/set_nsid.t           | 2 +-
 testsuite/tests/ip/netns/set_nsid_batch.t     | 2 +-
 testsuite/tests/ip/route/add_default_route.t  | 4 ++--
 testsuite/tests/ip/tunnel/add_tunnel.t        | 2 +-
 testsuite/tests/tc/cls-testbed.t              | 2 +-
 testsuite/tests/tc/dsmark.t                   | 2 +-
 testsuite/tests/tc/pedit.t                    | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
testsuite/tests/ip/link/new_link.t +1 -1
index 699adbcd..c17650a2 100755
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing add/del virtual links]"
 
testsuite/tests/ip/link/show_dev_wo_vf_rate.t +1 -1
index a600ba65..5b3c004e 100755
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 NL_FILE="tests/ip/link/dev_wo_vf_rate.nl"
 ts_ip "$0" "Show VF devices w/o VF rate info" -d monitor file $NL_FILE
testsuite/tests/ip/netns/set_nsid.t +1 -1
index 606d45ab..8f8c7792 100755
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing netns nsid]"
 
testsuite/tests/ip/netns/set_nsid_batch.t +1 -1
index abb3f1bb..196fd4b3 100755
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing netns nsid in batch mode]"
 
testsuite/tests/ip/route/add_default_route.t +2 -2
index e5ea6473..0b566f1f 100755
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing add default route]"
 
testsuite/tests/ip/tunnel/add_tunnel.t +1 -1
index 18f6e370..3f5a9d3c 100755
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 TUNNEL_NAME="tunnel_test_ip"
 
testsuite/tests/tc/cls-testbed.t +1 -1
index 2afc26fc..d5c21e5c 100755
@@ -1,7 +1,7 @@
 #!/bin/bash
 # vim: ft=sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 QDISCS="cbq htb dsmark"
 
testsuite/tests/tc/dsmark.t +1 -1
index 6934165e..177585e6 100755
@@ -1,7 +1,7 @@
 #!/bin/bash
 # vim: ft=sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_qdisc_available "dsmark"
 if [ $? -eq 0 ]; then
testsuite/tests/tc/pedit.t +1 -1
index e9b6c333..8d531a05 100755
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 DEV="$(rand_dev)"
 ts_ip "$0" "Add $DEV dummy interface" link add dev $DEV type dummy
Signature · 1 line
2.14.2
#2 lore raw
Quoted 7 lines · Stephen Hemminger
Quoted 1 line · On Sun, 8 Oct 2017 16:39:16 +0200 Petr Vorel <[email protected]> wrote:

Ok, applied. But iproute2 is really limited to Linux and bash is lingua franca on Linux

no French, please. Some distros use dash, but being POSIX is usually good.

Signature · 1 line
~Randy
#3 lore raw
In reply to Petr Vorel

testsuite/tests/ip/route/add_default_route.t line 1

Quoted 9 lines · Petr Vorel
testsuite/tests/ip/route/add_default_route.t +1 -1
index e5ea6473..0b566f1f 100755
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash

Funny - ^^^ choosing bash explicitly while
vvvv removing the bashism?

Quoted 4 lines
testsuite/tests/ip/route/add_default_route.t +1 -1
-source lib/generic.sh
+. lib/generic.sh
 

ts_log "[Testing add default route]"

I noticed a couple other files already specified /bin/bash, yet you removed the bashisms. But the above struck me as something that would not seem to have been intended.

author
#4 lore raw

Hi Mark,

Quoted 8 lines

testsuite/tests/ip/route/add_default_route.t line 1

Quoted 5 lines
testsuite/tests/ip/route/add_default_route.t +1 -1
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash

Funny - ^^^ choosing bash explicitly while
vvvv removing the bashism?

Eh, this is really silly, sorry. I've sent a patch to revert it back as it was unintentional.

Quoted 1 line

I noticed a couple other files already specified /bin/bash, yet you removed the bashisms. But the above struck me as something that would not seem to have been intended.

I plan to remove all bashisms. Although having explicit dependency on bash (i.e. /bin/bash in shebang), it would be nice have posix compliant shell scripts (as Randy Dunlap also noted). Or at least don't have bashisms in script with /bin/sh shebang.

Kind regards,
Petr