diff mbox series

[ovs-dev,10/13] tests: Add support for 1-argument 'seq' in emulation.

Message ID 20171007004458.5788-11-blp@ovn.org
State Accepted
Headers show
Series clustering implementation, part 1 | expand

Commit Message

Ben Pfaff Oct. 7, 2017, 12:44 a.m. UTC
The testsuite has an emulation of the common utility 'seq' that only
supported 2- and 3-argument forms.  This commit adds support for the
1-argument form.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 tests/ovs-macros.at | 3 +++
 1 file changed, 3 insertions(+)

Comments

Russell Bryant Oct. 9, 2017, 8:03 p.m. UTC | #1
On Fri, Oct 6, 2017 at 8:44 PM, Ben Pfaff <blp@ovn.org> wrote:
> The testsuite has an emulation of the common utility 'seq' that only
> supported 2- and 3-argument forms.  This commit adds support for the
> 1-argument form.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Russell Bryant <russell@ovn.org>
diff mbox series

Patch

diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index dbce0a5013aa..f452bbeb45cf 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -57,6 +57,9 @@  ovs_wait () {
 
 # Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout.
 seq () {
+    if test $# = 1; then
+        set 1 $1
+    fi
     while test $1 -le $2; do
         echo $1
         set `expr $1 + ${3-1}` $2 $3