Bug 1378873

Summary: the problematic behavior of the system.upgradeEntitlement
Product: Red Hat Satellite 5 Reporter: Martin Korbel <mkorbel>
Component: APIAssignee: Jiří Dostál <jdostal>
Status: CLOSED CURRENTRELEASE QA Contact: Radovan Drazny <rdrazny>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 570CC: jdostal, rdrazny, tkasparek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-2.5.14-38-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:14:33 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:    
Bug Blocks: 1340444    

Description Martin Korbel 2016-09-23 12:28:59 UTC
Description of problem:
The system.upgradeEntitlement does not return a fail status. (Sat5.7, Sat5.6)

Version-Release number of selected component (if applicable):
spacewalk-java-2.3.8-153.el6sat
spacewalk-java-2.0.2-112.el6sat.

How reproducible:
100%

Steps to Reproduce:
1. We have got a satellite with registered systems
2. We choose one without base channel and try to setup "virtualization" entitlement by WebUI. We get something as "Could not automatically subscribe the system to the RHEL Virtualization Channel. This channel contains packages required for virtualization. This is most likely caused by a lack of channel entitlements."
3. Now we can try it again for the same profile by API
> spacewalk-api --server=localhost --user=admin --password=xxx system.upgradeEntitlement "%session%" 1000077107 'virtualization_host'
$result = '1';

> spacewalk-api --server=localhost --user=admin --password=xxx system.getEntitlements "%session%" 1000077107
$result = [
            'enterprise_entitled'
          ];

Actual results:
  system.upgradeEntitlement return 1 (success)

Expected results:
  error

Additional info:

Comment 1 Jiří Dostál 2016-09-30 12:59:59 UTC
spacewalk.git d4680f87655e139fe4d3cecb5319a8ed3ed65dbd

Comment 3 Jiří Dostál 2016-10-31 17:47:47 UTC
Please ignore comment 1, enclosed commit is not related to this BZ.

Comment 6 Radovan Drazny 2017-01-30 14:17:02 UTC
Verified on spacewalk-java-2.5.14-43.

Attempt to upgrade entitlement in the WebUI using steps from the initial report fails with the followning message:

1 system(s) failed to add Virtualization(Platform). This was caused by errors attempting to automatically subscribe the system to the Red Hat Satellite Tools and RHEL Virtualization channels which are required for virtualization.

Trying to add the entitlement using the API fails with an error as well:

# spacewalk-api --server localhost --user=admin --password xxx system.upgradeEntitlement "%session%" 1000010000 'virtualization host'
Fault returned from XML RPC Server, fault code -212: redstone.xmlrpc.XmlRpcFault: Invalid entitlement

# spacewalk-api --server localhost --user=admin --password xxx system.getEntitlements "%session%" 1000010000
$result = [
            'enterprise_entitled',
            'provisioning_entitled'
          ];

VERIFIED