Bug 1476827 - scripts: invalid test in S32gluster_enable_shared_storage.sh
Summary: scripts: invalid test in S32gluster_enable_shared_storage.sh
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: glusterd
Version: rhgs-3.3
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
: RHGS 3.4.0
Assignee: Kaleb KEITHLEY
QA Contact: Bala Konda Reddy M
URL:
Whiteboard: rebase
Depends On: 1476785 1478498
Blocks: 1476819 1476822 1503134
TreeView+ depends on / blocked
 
Reported: 2017-07-31 14:37 UTC by Kaleb KEITHLEY
Modified: 2018-09-04 06:35 UTC (History)
7 users (show)

Fixed In Version: glusterfs-3.12.2-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1476785
Environment:
Last Closed: 2018-09-04 06:34:23 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2607 0 None None None 2018-09-04 06:35:54 UTC

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


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