Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: crowbar/barclamp-tempest
...
head fork: Blackavar/barclamp-tempest
compare: master
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 09, 2012
Greg Althaus galthaus Merge pull request #1 from MirantisDellCrowbar/master
doing a huge piece of refactoring to the tempest UI part
880b353
Commits on Aug 27, 2012
Greg Althaus galthaus Start port to CB2.0. Let's get past install first. Then on to working. 406129a
Greg Althaus galthaus Add importer for barclamp 4c6d878
Greg Althaus galthaus Merge pull request #3 from galthaus/pull-req-master-4c6d878196
Start porting tempest to cb20 fix some nits for ubuntu start working rh62 [2/7]
bc3adda
63 crowbar.yml
View
@@ -28,72 +28,11 @@ smoketest:
timeout: 2400
crowbar:
- layout: 1
+ layout: 2
order: 99
run_order: 99
chef_order: 99
-nav:
- utils:
- tempest: '"/tempest/dashboard/", { :link => { :target => "_blank" } }'
-
-locale_additions:
- en:
- nav:
- tempest: Tempest
- barclamp:
- tempest:
- run:
- success: "Sucessfully started tempest on node %{node}"
- failure: "Failed to run tempest on node %{node}: %{error}"
- duplicate: "there's already an active tempest run"
-
- dashboard:
- title: Tempest
- n_test_runs: "%{n} test run(s)"
- no_test_runs: No test runs
-
- run:
- label: Run tempest on node
- do: Go!
- no_nodes: No nodes with installed tempest available
- clear:
- do: Clear
- success: All non-running and stale test runs were cleared
-
- test_run:
- node: Node
- started: Started
- ended: Ended
- status: Status
- status_:
- running: Running
- passed: Passed
- failed: Failed
-
- results:
- title: "Results of tempest run %{test_run}"
- raw_xml: Raw XML
- test:
- name: Name
- time: Time
- status: Status
- status_:
- error: Error
- failure: Failure
- passed: Passed
- skipped: Skipped
-
- edit_attributes:
- attributes: Attributes
- nova_instance: Nova
- tempest_user: Tempest user and a tenant that will be created for test run
- tempest_user_username: Choose username
- tempest_user_password: Choose password
- tempest_user_tenant: Choose tenant
- edit_deployment:
- deployment: Deployment
-
debs:
#Assuming that packages for ubuntu 12.04 only used
pkgs:
19 crowbar_framework/app/controllers/tempest_controller.rb
View
@@ -1,4 +1,4 @@
-# Copyright 2011, Dell
+#
# Copyright 2012, Dell
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,17 +16,14 @@
require "rexml/document"
class TempestController < BarclampController
- def initialize
- @service_object = TempestService.new logger
- end
def raise_not_found
raise ActionController::RoutingError.new('Not Found')
end
def dashboard
- @test_runs = @service_object.get_test_runs
- @ready_nodes = @service_object.get_ready_nodes
+ @test_runs = operations.get_test_runs
+ @ready_nodes = operations.get_ready_nodes
@nodes_hash = TempestService.get_all_nodes_hash
render :template => "barclamp/#{@bc_name}/dashboard.html.haml"
end
@@ -34,12 +31,12 @@ def dashboard
def test_runs
# POST /tempest/test_runs/clear
if (request.post? or request.put?) and params[:id] == 'clear'
- @service_object.clear_test_runs
+ operations.clear_test_runs
flash[:notice] = t "barclamp.#{@bc_name}.dashboard.clear.success"
# POST /tempest/test_runs
elsif request.post? or request.put?
begin
- test_run = @service_object.run_test params[:node]
+ test_run = operations.run_test params[:node]
flash[:notice] = t "barclamp.#{@bc_name}.run.success", :node => params[:node]
rescue TempestService::ServiceError => error
flash[:notice] = t "barclamp.#{@bc_name}.run.failure", :node => params[:node], :error => error
@@ -50,7 +47,7 @@ def test_runs
# GET /tempest/test_runs/<test-run-id>
elsif uuid = params[:id]
- @test_run = @service_object.get_test_run_by_uuid(uuid) or raise_not_found
+ @test_run = operations.get_test_run_by_uuid(uuid) or raise_not_found
respond_to do |format|
format.json { render :json => @test_result }
format.html { redirect_to "/#{@bc_name}/results/#{uuid}.html" }
@@ -58,7 +55,7 @@ def test_runs
# GET /tempest/test_runs
else
- @test_runs = @service_object.get_test_runs
+ @test_runs = operations.get_test_runs
respond_to do |format|
format.json { render :json => @test_runs }
format.html { nil } # redirect to dashboard
@@ -79,7 +76,7 @@ def _prepare_results_html(test_run)
end
def results
- @test_run = @service_object.get_test_run_by_uuid(params[:id])
+ @test_run = operations.get_test_run_by_uuid(params[:id])
raise_not_found if not @test_run or @test_run['status'] == 'running'
respond_to do |format|
32 crowbar_framework/app/models/tempest_service.rb
View
@@ -19,14 +19,10 @@ class TempestService < ServiceObject
class ServiceError < StandardError
end
- def initialize(thelogger)
- @bc_name = "tempest"
- @logger = thelogger
- end
-
- def proposal_dependencies(role)
+ def proposal_dependencies(new_config)
answer = []
- answer << { "barclamp" => "nova", "inst" => role.default_attributes["tempest"]["nova_instance"] }
+ hash = new_config.config_hash
+ answer << { "barclamp" => "nova", "inst" => hash["tempest"]["nova_instance"] }
answer
end
@@ -36,35 +32,39 @@ def create_proposal
base = super
@logger.debug("Tempest create_proposal: leaving base part")
+ hash = base.config_hash
+
nodes = NodeObject.find("roles:nova-multi-controller")
nodes.delete_if { |n| n.nil? or n.admin? }
unless nodes.empty?
- base["deployment"]["tempest"]["elements"] = {
+ hash["tempest"]["elements"] = {
"tempest" => [ nodes.first.name ]
}
end
- base["attributes"]["tempest"]["nova_instance"] = ""
+ hash["tempest"]["nova_instance"] = ""
begin
- novaService = NovaService.new(@logger)
- novas = novaService.list_active[1]
+ novaService = Barclamp.find_by_name("nova")
+ novas = novaService.active_proposals
if novas.empty?
# No actives, look for proposals
- novas = novaService.proposals[1]
+ novas = novaService.proposals
end
- base["attributes"]["tempest"]["nova_instance"] = novas[0] unless novas.empty?
+ hash["tempest"]["nova_instance"] = novas[0].name unless novas.empty?
rescue
@logger.info("Tempest create_proposal: no nova found")
end
- base["attributes"]["tempest"]["tempest_user_username"] = "tempest-user-" + random_password
- base["attributes"]["tempest"]["tempest_user_tenant"] = "tempest-tenant-" + random_password
- base["attributes"]["tempest"]["tempest_user_password"] = random_password
+ hash["tempest"]["tempest_user_username"] = "tempest-user-" + random_password
+ hash["tempest"]["tempest_user_tenant"] = "tempest-tenant-" + random_password
+ hash["tempest"]["tempest_user_password"] = random_password
+ base.config_hash = hash
@logger.debug("Tempest create_proposal: exiting")
base
end
+ # GREG: HERE DOWN STILL NEEDS A PORT TO CB2.0
def apply_role_pre_chef_call(old_role, role, all_nodes)
@logger.debug("Tempest apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
73 crowbar_framework/config/locales/tempest/en.yml
View
@@ -0,0 +1,73 @@
+# Copyright 2011, Dell
+# Copyright 2012, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+en:
+ nav:
+ tempest: Tempest
+ tempest_description: Test framework for validating OpenStack
+ barclamp:
+ tempest:
+ run:
+ success: "Sucessfully started tempest on node %{node}"
+ failure: "Failed to run tempest on node %{node}: %{error}"
+ duplicate: "there's already an active tempest run"
+
+ dashboard:
+ title: Tempest
+ n_test_runs: "%{n} test run(s)"
+ no_test_runs: No test runs
+
+ run:
+ label: Run tempest on node
+ do: Go!
+ no_nodes: No nodes with installed tempest available
+ clear:
+ do: Clear
+ success: All non-running and stale test runs were cleared
+
+ test_run:
+ node: Node
+ started: Started
+ ended: Ended
+ status: Status
+ status_:
+ running: Running
+ passed: Passed
+ failed: Failed
+
+ results:
+ title: "Results of tempest run %{test_run}"
+ raw_xml: Raw XML
+ test:
+ name: Name
+ time: Time
+ status: Status
+ status_:
+ error: Error
+ failure: Failure
+ passed: Passed
+ skipped: Skipped
+
+ edit_attributes:
+ attributes: Attributes
+ nova_instance: Nova
+ tempest_user: Tempest user and a tenant that will be created for test run
+ tempest_user_username: Choose username
+ tempest_user_password: Choose password
+ tempest_user_tenant: Choose tenant
+ edit_deployment:
+ deployment: Deployment
+
24 crowbar_framework/db/migrate/20120827092800_tempest_navs.rb
View
@@ -0,0 +1,24 @@
+# Copyright 2012, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+class TempestNavs < ActiveRecord::Migration
+ def self.up
+ Nav.find_or_create_by_item :item=>'tempest_dashboard', :parent_item=>'utils', :name=>'nav.tempest', :description=>'nav.tempest_description', :path=>'\'"/tempest/dashboard/", { :link => { :target => "_blank" } }\'', :order=>500
+ end
+
+ def self.down
+ Nav.delete_by_item 'tempest_dashboard'
+ end
+end
23 crowbar_framework/db/migrate/20120827093000_barclamp_import_tempest.rb
View
@@ -0,0 +1,23 @@
+# Copyright 2012, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+class BarclampImportTempest < ActiveRecord::Migration
+ def up
+ Barclamp.import_1x 'tempest'
+ end
+
+ def down
+ Barclamp.delete(Barclamp.find_by_name 'tempest')
+ end
+end

No commit comments for this range

Something went wrong with that request. Please try again.