forked from vmoravec/cct
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb2bdc3
commit 494aa8a
Showing
6 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@keystone | ||
Feature: Tests Openstack Keystone barclamp | ||
As an actor | ||
I want to perform various validations | ||
In order to verify the feature functionality | ||
|
||
Background: | ||
Given the chef role "keystone-server" exists on admin node | ||
And the "keystone" cookbook exists on the admin node | ||
|
||
Scenario: Keystone deployment and functioning | ||
Given the barclamp proposal is using the keystone identity service | ||
When the node with keystone-server role has been detected successfully | ||
And the "python-keystone" is installed in the controller node | ||
And the "python-openstackclient" is installed in the controller node | ||
Then I can create a new project "cucumber_test" on the cloud | ||
And I can create a new user "cucumber_user" for the "cucumber_test" project | ||
And I can see the list of all available hosts on the cloud | ||
And I can delete the project "cucumber_test" and user "cucumber_user" | ||
|
||
|
54 changes: 54 additions & 0 deletions
54
features/step_definitions/barclamp_keystone/keystone_steps.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Given(/^the chef role "([^"]*)" exists on admin node$/) do |arg1| | ||
keystone_server_role = admin_node.exec!("knife role show keystone-server").output | ||
expect(keystone_server_role).not_to be_empty | ||
end | ||
|
||
And(/^the "([^"]*)" cookbook exists on the admin node$/) do |arg1| | ||
keystone_cookbook = admin_node.exec!("knife cookbook show keystone").output | ||
expect(keystone_cookbook).not_to be_empty | ||
end | ||
|
||
And(/^the barclamp proposal is using the keystone identity service$/) do | ||
json_response = JSON.parse(admin_node.exec!("crowbar keystone show default").output) | ||
@node_fqdn = json_response["deployment"]["keystone"]["elements"]["keystone-server"][0] | ||
expect(@node_fqdn).not_to be_empty | ||
end | ||
|
||
When(/^the node with keystone-server role has been detected successfully$/) do | ||
user_list = control_node.openstack.user.list | ||
expect(user_list).not_to be_empty | ||
end | ||
|
||
And(/^the "([^"]*)" is installed in the controller node$/) do |test_package| | ||
control_node.rpm_q(test_package) | ||
end | ||
|
||
And(/^the "([^"]*)" is installed on the controller node$/) do |client_package| | ||
control_node.rpm_q(client_package) | ||
end | ||
|
||
Then(/^I can create a new project "([^"]*)" on the cloud$/) do |project_name| | ||
response = control_node.openstack.project.create(project_name) | ||
puts "Project #{response.name} created with ID: #{response.id}" | ||
expect(response.name).to eq(project_name) | ||
end | ||
|
||
And(/^I can create a new user "([^"]*)" for the "([^"]*)" project$/) do |user_name, project_name| | ||
response = control_node.openstack.user.create(user_name, | ||
project: project_name) | ||
puts "Created user #{response.name} on Project : #{response.project_id}" | ||
expect(response.name).to eq(user_name) | ||
end | ||
|
||
And(/^I can see the list of all available hosts on the cloud$/) do | ||
host_list = control_node.openstack.host.list | ||
puts "List of hosts available" | ||
host_list.each do |host| | ||
puts "Name: #{host.name} Service: #{host.service} Zone: #{host.zone}" | ||
end | ||
end | ||
|
||
And(/^I can delete the project "([^"]*)" and user "([^"]*)"$/) do |project_name, user_name| | ||
control_node.openstack.user.delete(user_name) | ||
control_node.openstack.project.delete(project_name) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Cct | ||
module Commands | ||
module Openstack | ||
class Host < Command | ||
self.command = "host" | ||
|
||
def list *options | ||
super(*(options << {row: Struct.new(:name, :service, :zone)})) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace :feature do | ||
feature_name "Tests Openstack Keystone barclamp" | ||
|
||
namespace :barclamp do | ||
desc "Barclamp Keystone feature" | ||
feature_task :keystone, tags: :@keystone | ||
|
||
desc "Verification of 'Tests Openstack Keystone barclamp' feature" | ||
feature_task :all | ||
end | ||
end |