diff mbox series

tests: Remove bashisms (s/source/.)

Message ID 20171008143916.21813-1-petr.vorel@gmail.com
State Accepted, archived
Delegated to: stephen hemminger
Headers show
Series tests: Remove bashisms (s/source/.) | expand

Commit Message

Petr Vorel Oct. 8, 2017, 2:39 p.m. UTC
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 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(-)

Comments

Stephen Hemminger Oct. 11, 2017, 6:01 p.m. UTC | #1
On Sun,  8 Oct 2017 16:39:16 +0200
Petr Vorel <petr.vorel@gmail.com> wrote:

> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

Ok, applied. But iproute2 is really limited to Linux and bash is lingua franca on Linux
Randy Dunlap Oct. 11, 2017, 6:02 p.m. UTC | #2
On 10/11/17 11:01, Stephen Hemminger wrote:
> On Sun,  8 Oct 2017 16:39:16 +0200
> Petr Vorel <petr.vorel@gmail.com> wrote:
> 
>> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> 
> 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.
Rustad, Mark D Oct. 13, 2017, 5:55 p.m. UTC | #3
> On Oct 8, 2017, at 7:39 AM, Petr Vorel <petr.vorel@gmail.com> wrote:
> 
> diff --git a/testsuite/tests/ip/route/add_default_route.t b/testsuite/tests/ip/route/add_default_route.t
> index e5ea6473..0b566f1f 100755
> --- a/testsuite/tests/ip/route/add_default_route.t
> +++ b/testsuite/tests/ip/route/add_default_route.t
> @@ -1,6 +1,6 @@
> -#!/bin/sh
> +#!/bin/bash

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

> -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.

--
Mark Rustad, Networking Division, Intel Corporation
Petr Vorel Oct. 15, 2017, 10:05 a.m. UTC | #4
Hi Mark,

> > --- a/testsuite/tests/ip/route/add_default_route.t
> > +++ b/testsuite/tests/ip/route/add_default_route.t
> > @@ -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.


> 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
diff mbox series

Patch

diff --git a/testsuite/tests/ip/link/new_link.t b/testsuite/tests/ip/link/new_link.t
index 699adbcd..c17650a2 100755
--- a/testsuite/tests/ip/link/new_link.t
+++ b/testsuite/tests/ip/link/new_link.t
@@ -1,6 +1,6 @@ 
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing add/del virtual links]"
 
diff --git a/testsuite/tests/ip/link/show_dev_wo_vf_rate.t b/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
index a600ba65..5b3c004e 100755
--- a/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
+++ b/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
@@ -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
diff --git a/testsuite/tests/ip/netns/set_nsid.t b/testsuite/tests/ip/netns/set_nsid.t
index 606d45ab..8f8c7792 100755
--- a/testsuite/tests/ip/netns/set_nsid.t
+++ b/testsuite/tests/ip/netns/set_nsid.t
@@ -1,6 +1,6 @@ 
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing netns nsid]"
 
diff --git a/testsuite/tests/ip/netns/set_nsid_batch.t b/testsuite/tests/ip/netns/set_nsid_batch.t
index abb3f1bb..196fd4b3 100755
--- a/testsuite/tests/ip/netns/set_nsid_batch.t
+++ b/testsuite/tests/ip/netns/set_nsid_batch.t
@@ -1,6 +1,6 @@ 
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing netns nsid in batch mode]"
 
diff --git a/testsuite/tests/ip/route/add_default_route.t b/testsuite/tests/ip/route/add_default_route.t
index e5ea6473..0b566f1f 100755
--- a/testsuite/tests/ip/route/add_default_route.t
+++ b/testsuite/tests/ip/route/add_default_route.t
@@ -1,6 +1,6 @@ 
-#!/bin/sh
+#!/bin/bash
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_log "[Testing add default route]"
 
diff --git a/testsuite/tests/ip/tunnel/add_tunnel.t b/testsuite/tests/ip/tunnel/add_tunnel.t
index 18f6e370..3f5a9d3c 100755
--- a/testsuite/tests/ip/tunnel/add_tunnel.t
+++ b/testsuite/tests/ip/tunnel/add_tunnel.t
@@ -1,6 +1,6 @@ 
 #!/bin/sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 TUNNEL_NAME="tunnel_test_ip"
 
diff --git a/testsuite/tests/tc/cls-testbed.t b/testsuite/tests/tc/cls-testbed.t
index 2afc26fc..d5c21e5c 100755
--- a/testsuite/tests/tc/cls-testbed.t
+++ b/testsuite/tests/tc/cls-testbed.t
@@ -1,7 +1,7 @@ 
 #!/bin/bash
 # vim: ft=sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 QDISCS="cbq htb dsmark"
 
diff --git a/testsuite/tests/tc/dsmark.t b/testsuite/tests/tc/dsmark.t
index 6934165e..177585e6 100755
--- a/testsuite/tests/tc/dsmark.t
+++ b/testsuite/tests/tc/dsmark.t
@@ -1,7 +1,7 @@ 
 #!/bin/bash
 # vim: ft=sh
 
-source lib/generic.sh
+. lib/generic.sh
 
 ts_qdisc_available "dsmark"
 if [ $? -eq 0 ]; then
diff --git a/testsuite/tests/tc/pedit.t b/testsuite/tests/tc/pedit.t
index e9b6c333..8d531a05 100755
--- a/testsuite/tests/tc/pedit.t
+++ b/testsuite/tests/tc/pedit.t
@@ -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