Bug 1476827

Summary: scripts: invalid test in S32gluster_enable_shared_storage.sh
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Kaleb KEITHLEY <kkeithle>
Component: glusterdAssignee: Kaleb KEITHLEY <kkeithle>
Status: CLOSED ERRATA QA Contact: Bala Konda Reddy M <bmekala>
Severity: unspecified Docs Contact:
Priority: low    
Version: rhgs-3.3CC: amukherj, bugs, rhinduja, rhs-bugs, sheggodu, storage-qa-internal, vbellur
Target Milestone: ---Keywords: Triaged
Target Release: RHGS 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: rebase
Fixed In Version: glusterfs-3.12.2-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1476785 Environment:
Last Closed: 2018-09-04 06:34:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1476785, 1478498    
Bug Blocks: 1476819, 1476822, 1503134    

Description Kaleb KEITHLEY 2017-07-31 14:37:36 UTC
+++ 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; for strings use "=".

Also note the comment in the man page that says -a and -o are ambiguous and use [ foo ] && [ foo ] or [ foo ] || [ foo ]

The correct syntax should be 
   
   if [ "$key" != "cluster.enable-shared-storage" ] && [ "$key" != "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)

Comment 3 Atin Mukherjee 2017-08-09 12:52:39 UTC
upstream patch : https://review.gluster.org/#/c/17925/

Comment 6 Bala Konda Reddy M 2018-04-30 10:29:26 UTC
Build : 3.12.2-8

The test syntax has been updated as mentioned in the description.
Enabling and disabling shared storage succeeded without any issues

Hence marking it as verified.

Comment 8 errata-xmlrpc 2018-09-04 06:34:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2607