Use clouds.yaml credentials for admin functional tests.

Credentials for the admin devstack configuration are no
longer hardcoded. Thus, if infra changes the DSVM config,
we should pick up the changes.

Change-Id: I8924120aae8a8843d57327793bebce839dea0ebd
This commit is contained in:
Michael Krotscheck
2016-09-01 10:54:43 -07:00
parent 2d61baca21
commit 71fef1257b

View File

@@ -20,6 +20,7 @@ import config from "./helpers/cloudsConfig";
describe("Keystone", () => { describe("Keystone", () => {
let devstackConfig = config.clouds.devstack; let devstackConfig = config.clouds.devstack;
let adminConfig = config.clouds['devstack-admin'];
let keystone = new Keystone(devstackConfig); let keystone = new Keystone(devstackConfig);
describe("versions()", () => { describe("versions()", () => {
@@ -88,7 +89,12 @@ describe("Keystone", () => {
it("should permit passing your own user, password, and project.", (done) => { it("should permit passing your own user, password, and project.", (done) => {
keystone keystone
.tokenIssue('admin', 'password', 'admin', 'default', 'default') .tokenIssue(
adminConfig.auth.username,
adminConfig.auth.password,
adminConfig.auth.project_name,
adminConfig.auth.user_domain_id,
adminConfig.auth.project_domain_id)
.then((token) => { .then((token) => {
expect(token).not.toBeNull(); expect(token).not.toBeNull();
done(); done();
@@ -137,9 +143,9 @@ describe("Keystone", () => {
it("should allow an admin to revoke another token.", (done) => { it("should allow an admin to revoke another token.", (done) => {
let adminToken; let adminToken;
let adminKeystone = new Keystone(adminConfig);
keystone adminKeystone.tokenIssue() // Get an admin token.
.tokenIssue('admin', 'password', 'admin', 'default', 'default') // Create an Admin token.
.then((token) => { .then((token) => {
adminToken = token; adminToken = token;
return keystone.tokenIssue(); // Regular token. return keystone.tokenIssue(); // Regular token.