Bug 1476819 - scripts: invalid test in S32gluster_enable_shared_storage.sh
scripts: invalid test in S32gluster_enable_shared_storage.sh
Product: GlusterFS
Classification: Community
Component: scripts (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Kaleb KEITHLEY
: Triaged
Depends On: 1476827 1476785 1476822 1478498
Blocks: glusterfs-3.12.0
  Show dependency treegraph
Reported: 2017-07-31 10:19 EDT by Kaleb KEITHLEY
Modified: 2017-09-05 13:38 EDT (History)
1 user (show)

See Also:
Fixed In Version: glusterfs-3.12.0
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1476785
Last Closed: 2017-09-05 13:38:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kaleb KEITHLEY 2017-07-31 10:19:56 EDT
+++ 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:

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@redhat.com)
Comment 1 Worker Ant 2017-07-31 10:24:50 EDT
REVIEW: https://review.gluster.org/17926 (scripts: invalid test(1) in extras/S32gluster_enable_shared_storage.sh) posted (#1) for review on release-3.12 by Kaleb KEITHLEY (kkeithle@redhat.com)
Comment 2 Worker Ant 2017-08-02 11:10:51 EDT
COMMIT: https://review.gluster.org/17926 committed in release-3.12 by Shyamsundar Ranganathan (srangana@redhat.com) 
commit 3558d83c34933aea6d53fd3ad96c0828798474cd
Author: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Date:   Mon Jul 31 10:22:54 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
    Change-Id: Ia544f7295e247b981504d085ebc4c533ab60ba84
    BUG: 1476819
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
    Reviewed-on: https://review.gluster.org/17926
    Smoke: Gluster Build System <jenkins@build.gluster.org>
    CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
    Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Comment 3 Shyamsundar 2017-09-05 13:38:10 EDT
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.12.0, please open a new bug report.

glusterfs-3.12.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2017-September/000082.html
[2] https://www.gluster.org/pipermail/gluster-users/

Note You need to log in before you can comment on or make changes to this bug.