Use new devstack-logs publisher

Instead of pasting all the logs onto the console, we can now have them
saved seperately by the devstack-logs publisher.

Add "|| true" rescue commands to the chef-client invocations, so that
rake will continue to run through to the save_logs even if the chef run
fails.

Change-Id: I475509d770e90da38ba76d4fe126d6610ef280e2
This commit is contained in:
Jens Rosenboom 2016-03-11 09:55:21 +01:00
parent 6bd258c249
commit 960b72804a

View File

@ -147,20 +147,16 @@ end
# Helper for setting up tempest and upload the default cirros image. Tempest # Helper for setting up tempest and upload the default cirros image. Tempest
# itself is not yet used for integration tests. # itself is not yet used for integration tests.
def _setup_tempest(client_opts) def _setup_tempest(client_opts)
sh %(sudo chef-client #{client_opts} -E allinone-ubuntu14 -r 'recipe[openstack-integration-test::setup]') sh %(sudo chef-client #{client_opts} -E allinone-ubuntu14 -r 'recipe[openstack-integration-test::setup]' || true)
end end
def _dump_logs def _save_logs(prefix)
paths = [] sh %(sleep 25)
%w(nova neutron keystone cinder glance heat).each do |project| %w(nova neutron keystone cinder glance heat).each do |project|
paths << "-r \"\" /etc/#{project}/*" sh %(mkdir -p logs/#{prefix}/#{project})
paths << "-r \"\" /var/log/#{project}/*" sh %(sudo cp -r /etc/#{project} logs/#{prefix}/#{project}/etc)
sh %(sudo cp -r /var/log/#{project} logs/#{prefix}/#{project}/log)
end end
_run_commands('Dump Logs', {
'sleep' => ['25'],
'grep' => paths }
)
end end
desc "Integration test on Infra" desc "Integration test on Infra"
@ -173,14 +169,14 @@ task :integration => [:create_key, :berks_vendor] do
for i in 1..3 for i in 1..3
puts "####### Pass #{i}" puts "####### Pass #{i}"
# Kick off chef client in local mode, will converge OpenStack right on the gate job "in place" # Kick off chef client in local mode, will converge OpenStack right on the gate job "in place"
sh %(sudo chef-client #{client_opts} -E allinone-ubuntu14 -r 'role[allinone]') sh %(sudo chef-client #{client_opts} -E allinone-ubuntu14 -r 'role[allinone]' || true)
_setup_tempest(client_opts) _setup_tempest(client_opts)
_dump_logs _save_logs("pass#{i}")
_setup_local_network if i == 1 _setup_local_network if i == 1
_run_basic_queries _run_basic_queries
_setup_cinder_volume _setup_cinder_volume
_run_nova_tests _run_nova_tests
end end
sh %(sudo chown -R $USER logs)
# TODO (jklare) utilise tempest to run tests against openstack # TODO (jklare) utilise tempest to run tests against openstack
# TODO (MRV) gather logs
end end