Skip to content

Commit 84b1c28

Browse files
committed
tempest: tempest run filters as templates (SOC-11052)
The tempest run filters employed by Crowbar are modeled as static files instead of being generated at runtime as chef templates. This makes it difficult to select which test cases are enabled/disabled depending on which features and options are actually configured. This change re-models tempest run filters as templates. (cherry picked from commit 8e1471a)
1 parent fdab3a0 commit 84b1c28

File tree

18 files changed

+31
-6
lines changed

18 files changed

+31
-6
lines changed

chef/cookbooks/tempest/recipes/config.rb

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,13 +646,38 @@
646646
)
647647
end
648648

649-
remote_directory "#{node[:tempest][:tempest_path]}/run_filters/" do
650-
source "run_filters"
651-
action :create
652-
recursive true
653-
end
654-
655649
cookbook_file "#{node[:tempest][:tempest_path]}/bin/tests2skip.py" do
656650
source "tests2skip.py"
657651
mode 0755
658652
end
653+
654+
# This is where tempest run filter templates are generated
655+
directory "#{node[:tempest][:tempest_path]}/run_filters" do
656+
mode 0o755
657+
action :create
658+
end
659+
660+
# Get the Chef::CookbookVersion for this cookbook
661+
cb = run_context.cookbook_collection["tempest"]
662+
663+
# Loop over the array of run filter template files
664+
cb.manifest["templates"].each do |cb_template|
665+
# cb_template['name'] is relative to the default
666+
# templates location, e.g.
667+
# 'run_filters/foo.txt.erb'
668+
filter_name = cb_template["name"].split(".erb")[0]
669+
670+
next unless filter_name =~ %r{run_filters\/.*txt}
671+
672+
template "#{node[:tempest][:tempest_path]}/#{filter_name}" do
673+
mode 0o640
674+
source "#{filter_name}.erb"
675+
variables(
676+
lazy do
677+
{
678+
enabled_services: enabled_services
679+
}
680+
end
681+
)
682+
end
683+
end

chef/cookbooks/tempest/files/default/run_filters/aodh.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/aodh.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/barbican.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/barbican.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/ceilometer.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/ceilometer.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/cinder.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/cinder.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/designate.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/designate.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/fwaas.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/fwaas.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/glance.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/glance.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/heat.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/heat.txt.erb

File renamed without changes.

chef/cookbooks/tempest/files/default/run_filters/keystone.txt renamed to chef/cookbooks/tempest/templates/default/run_filters/keystone.txt.erb

File renamed without changes.

0 commit comments

Comments
 (0)