Bug 808037

Summary: Scale application could be created successfully while specify parameter 'scale' to illegal value
Product: OKD Reporter: bzhao
Component: PodAssignee: Lili Nader <lnader>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, dmcphers, lnader, mfisher, mpatel, pruan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-13 18:33:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description bzhao 2012-03-29 12:08:28 UTC
Description of problem:
Scale application could be created successfully while not specify parameter 'scale' or specify parameter 'scale' value to illegal value, for example scale=truxxxx

Version-Release number of selected component (if applicable):
rhc-broker-0.89.6-1.el6_2.noarch
rhc-cartridge-haproxy-1.4-0.7.4-1.el6_2.noarch

How reproducible:
Always

Steps to Reproduce:
1. Not specify parameter 'scale' to creating a scale application
# curl -k -H "Accept: application/xml" --user "bzhao2:xx"  https://ec2-107-22-22-164.compute-1.amazonaws.com/broker/rest/domains/bzhao2/applications -X POST -d name=perlScale -d cartridge=perl-5.10
2.specify parameter 'scale' value to Illegal value to creating a scale application
curl -k -H "Accept: application/xml" --user "bzhao2:xx"  https://ec2-107-22-22-164.compute-1.amazonaws.com/broker/rest/domains/bzhao2/applications -X POST -d name=diyScale -d cartridge=perl-5.10 -d scale=truxx

  
Actual results:
In accordance with the above any way, the scale application will be created successfully

Expected results:
It should return "missing parameter 'scale' or the others"

Additional info:
Debug info of haproxy_ctld:
<scale_events.log>

# tailf logs/scale_events.log
D, [2012-03-29T08:05:46.582703 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:05:49.591497 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:05:52.598520 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:05:55.604904 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:05:58.611023 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:01.617164 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:04.624230 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:07.633467 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:10.654425 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:13.661176 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:16.668622 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:19.685859 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:22.692003 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20
D, [2012-03-29T08:06:25.704383 #26308] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 90.0%/49.9% sec_left_til_remove: 0 gear_remove_thresh: 0/20

Comment 1 Xiaoli Tian 2012-04-04 04:48:37 UTC
*** Bug 809277 has been marked as a duplicate of this bug. ***

Comment 2 bzhao 2012-04-10 08:50:33 UTC
It has still the issue on devenv_1705, i think this parameter 'scale' is used to determine whether you need to creating a scale type of application, if we specified parameter 'scale' to illegal value and the app could also created successfully, So the parameters will not have any significance.

Comment 3 bzhao 2012-04-11 11:10:02 UTC
It will create non scale application when i specified the parameter 'scale' to illegal value, its behavior is correct, but its return values is incorrect..

Part of the return messages are listed below.
<creation-time>2012-04-11T06:59:08-04:00</creation-time>
      <name>phpScaleFalse</name>
      <gear-profile>small</gear-profile>
      <uuid>42210d2201e7423b8e173d1c4384443c</uuid>
      <scalable nil="true"></scalable>

it created a non scale application, so scalable nil's value should be false..

Comment 4 bzhao 2012-04-12 10:31:34 UTC
Passed verification on devenv-stage_166