[Bugs] [Bug 1478498] New: scripts: invalid test in S32gluster_enable_shared_storage.sh

bugzilla at redhat.com bugzilla at redhat.com
Fri Aug 4 17:17:06 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1478498

            Bug ID: 1478498
           Summary: scripts: invalid test in
                    S32gluster_enable_shared_storage.sh
           Product: GlusterFS
           Version: 3.10
         Component: scripts
          Keywords: Triaged
          Assignee: bugs at gluster.org
          Reporter: kkeithle at redhat.com
                CC: bugs at gluster.org
        Depends On: 1476785
            Blocks: 1476819, 1476822, 1476827



+++ This bug was initially created as a clone of Bug #1476785 +++

Description of problem:

line 5:

   if [ ! "$key" -eq "enable-shared-storage" -o "$key" -eq
"cluster.enable-shared-storage" ]; then

man page for test(1) says -eq takes two integer arguments.

The correct syntax should be 

   if [ "$key" != "enable-shared-storage" -o "$key" =
"cluster.enable-shared-storage" ]; then

Or is it supposed to be:

   if [ ! ( "$key" = "enable-shared-storage" -o "$key" =
"cluster.enable-shared-storage" ) ]; then


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Worker Ant on 2017-07-31 09:53:01 EDT ---

REVIEW: https://review.gluster.org/17925 (scripts: invalid test(1) in
extras/S32gluster_enable_shared_storage.sh) posted (#1) for review on master by
Kaleb KEITHLEY (kkeithle at redhat.com)

--- Additional comment from Worker Ant on 2017-08-01 13:41:29 EDT ---

COMMIT: https://review.gluster.org/17925 committed in master by Shyamsundar
Ranganathan (srangana at redhat.com) 
------
commit 1ae3747608797445c4a59569f93edc331e3626b0
Author: Kaleb S. KEITHLEY <kkeithle at redhat.com>
Date:   Mon Jul 31 09:48:09 2017 -0400

    scripts: invalid test(1) in extras/S32gluster_enable_shared_storage.sh

    test(1) man pages says -eq is for INTEGER compares, and = is for
    string compares.

    Also note the comment that -a and -o are ambiguous and to use
     test && test or test || test instead.

    This bug has existed since 2015! (yikes)

    Found while testing localtime logging and running glusterd in the
    foreground.

    Change-Id: Ia544f7295e247b981504d085ebc4c533ab60ba84
    BUG: 1476785
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle at redhat.com>
    Reviewed-on: https://review.gluster.org/17925
    Reviewed-by: Niels de Vos <ndevos at redhat.com>
    Smoke: Gluster Build System <jenkins at build.gluster.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana at redhat.com>
    CentOS-regression: Gluster Build System <jenkins at build.gluster.org>


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1476785
[Bug 1476785] scripts: invalid test in S32gluster_enable_shared_storage.sh
https://bugzilla.redhat.com/show_bug.cgi?id=1476819
[Bug 1476819] scripts: invalid test in S32gluster_enable_shared_storage.sh
https://bugzilla.redhat.com/show_bug.cgi?id=1476822
[Bug 1476822] scripts: invalid test in S32gluster_enable_shared_storage.sh
https://bugzilla.redhat.com/show_bug.cgi?id=1476827
[Bug 1476827] scripts: invalid test in S32gluster_enable_shared_storage.sh
-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list