Skip to content

Commit f54cfa8

Browse files
authored
Merge pull request #2345 from stefannica/generate-run-filters
[5.0] tempest: tempest run filters as templates (SOC-11052)
2 parents fdab3a0 + 84b1c28 commit f54cfa8

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)