Bug 974326

Summary: [broker_50] oo-admin-chk should recognize missing usage_account_id field for silver_plan account
Product: OpenShift Online Reporter: Xiaoli Tian <xtian>
Component: PodAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED WONTFIX QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: rpenta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-14 05:22:38 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:

Description Xiaoli Tian 2013-06-14 01:17:07 UTC
Description of problem:
After upgrading an user to silver and remove the usage_account_id from cloud_users collections to simulate missing usage_account_id field situation,

And run oo-admin-chk -l 2 --verbose.

oo-admin-chk does not check this point and give it a PASS


Version-Release number of selected component (if applicable):
devenv_3353

How reproducible:
Always

Steps to Reproduce:
1. Create an account and upgrade it to silver
2. Check it's usage_account_id and remove this field from mongo
libra_rs:PRIMARY> db.cloud_users.find ({login: "xtian+bt1"},  {plan_id: 1, plan_state: 2, usage_account_id: 3})
{ "_id" : ObjectId("51b935b2c9c6fe945b000001"), "plan_id" : "silver", "plan_state" : "ACTIVE", "usage_account_id" : "2555331" }

libra_rs:PRIMARY> db.cloud_users.update({login: "xtian+bt1"}, {$unset: {usage_account_id : ""}})

libra_rs:PRIMARY> db.cloud_users.find ({login: "xtian+bt1"},  {plan_id: 1, plan_state: 2, usage_account_id: 3})
{ "_id" : ObjectId("51b935b2c9c6fe945b000001"), "plan_id" : "silver", "plan_state" : "ACTIVE" }


3. run oo-admin-chk -l 2 --verbose

Actual results:
It did not recognize the missing field


Expected results:
It should  check the missing fields as well.

Additional info:

Comment 1 Ravi Sankar 2013-06-14 05:22:38 UTC
We do not expect usage_account_id to be missing from cloud_users collection. Even if that happens (could not think of any situation), we don't want to introduce that check in oo-admin-chk, it's a very expensive operation and not worth it.