candlepin/candlepin — pull request #420 by jmrodri (2013-10-29 20:18:31+00:00)
Title: add order number to imported subscriptions.

TEST
--------
First let's verify the problem.

* get a manifest from stage
* deploy candlepin master ```buildconf/scripts/deploy```
* import manifest
```cd /client/ruby/
./cpc create_owner orgA
./cpc import orgA /path/to/manifest.zip
```
* subscribe a client to your candlepin
```subscription-manager register
Username: admin
Password: admin
Owner: orgA
```
* auto attach
```subscription-manager attach --auto```

VERIFY
-----------
* verify in database that the ordernumber is indeed EMPTY
```select o.account, s.ordernumber, s.contractnumber from cp_subscription s, cp_owner o where s.owner_id = o.id and o.account = 'orgA';```

* verify the entitlement certificate has no order number:
```rct cat-cert /etc/pki/entitlements/XXXXX.pem > /tmp/noorder.txt```
* open the file and look for the Order: section, see that the Number is empty.

RE-TEST
--------------
* checkout this branch
* redeploy
* import manifest
```cd /client/ruby/
./cpc create_owner orgA
./cpc import orgA /path/to/manifest.zip
```
* subscribe a client to your candlepin
```subscription-manager register
Username: admin
Password: admin
Owner: orgA
```
* auto attach
```subscription-manager attach --auto```

RE-VERIFY
-----------
* verify in database that the ordernumber is indeed filled in
```select o.account, s.ordernumber, s.contractnumber from cp_subscription s, cp_owner o where s.owner_id = o.id and o.account = 'orgA';```

* verify the entitlement certificate has an order number:
```rct cat-cert /etc/pki/entitlements/XXXXX.pem > /tmp/noorder.txt```
* open the file and look for the Order: section, see that the Number is NOT empty.