Commit 4d94c67d authored by Harald Sitter's avatar Harald Sitter 💎

add a new metadata system to get high level access to global metadata

this is primarily useful to get metadata out of the ISO so we know
what was installed initially.

this data is uploaded by the install core as soon as possible and later
(on success) moved to a metdata dir for archival.
so, for installs the metadata is in ulogs on error and metadata on success

for !install tests they pick up the metadata from the image storage to
seed their initial metadata dir (they may still added more info if
applicable).
they always have metadata (from the install), so even on errors we know
what the image contained

archival of this happens relative, so the metadata is in the main dir
parent 54531f9a
......@@ -13,6 +13,7 @@
/*.iso
/*.iso.zs-old
/*.sig
/metadata/
# qtcreator build dir
/needler/build-*/
......@@ -47,6 +47,7 @@ fancyNode('openqa') {
}
}
} finally {
dir('metadata') { archiveArtifacts '*' }
archiveArtifacts 'wok/testresults/*, wok/ulogs/*, wok/video.*'
junit 'junit/*'
sh 'bin/contain.rb chown -R jenkins .'
......
......@@ -37,6 +37,7 @@ fancyNode('openqa') {
}
}
} finally {
dir('metadata') { archiveArtifacts '*' }
archiveArtifacts 'wok/testresults/*, wok/ulogs/*, wok/video.*'
junit 'junit/*'
sh 'bin/contain.rb chown -R jenkins .'
......
......@@ -37,6 +37,7 @@ fancyNode('openqa') {
}
}
} finally {
dir('metadata') { archiveArtifacts '*' }
archiveArtifacts 'wok/testresults/*, wok/ulogs/*, wok/video.*'
junit 'junit/*'
sh 'bin/contain.rb chown -R jenkins .'
......
......@@ -36,6 +36,7 @@ fancyNode('openqa') {
}
}
} finally {
dir('metadata') { archiveArtifacts '*' }
archiveArtifacts 'wok/testresults/*, wok/ulogs/*, wok/video.*'
junit 'junit/*'
sh 'bin/contain.rb chown -R jenkins .'
......
......@@ -34,6 +34,7 @@ fancyNode('openqa') {
}
}
} finally {
dir('metadata') { archiveArtifacts '*' }
archiveArtifacts allowEmptyArchive: true, artifacts: 'wok/testresults/*, wok/ulogs/*, wok/video.*'
junit 'junit/*'
}
......
......@@ -51,6 +51,9 @@ end
Dir.mkdir('wok') unless File.exist?('wok')
Dir.chdir('wok')
FileUtils.rm_rf('../metadata', verbose: true)
FileUtils.mkdir('../metadata', verbose: true)
# Cloud scaled node, use all cores, else only half of them to not impair
# other functionality on the node.
cpus = Etc.nprocessors
......@@ -118,9 +121,19 @@ else
existing_raid = File.realpath('../raid')
if File.exist?(existing_raid)
warn "Overlaying existing #{existing_raid}"
FileUtils.rm_r('raid') if File.exist?('raid')
FileUtils.mkpath('raid')
system("qemu-img create -f qcow2 -o backing_file=#{existing_raid}/1 raid/1 20G") || raise
unless system("qemu-img create -f qcow2 -o backing_file=#{existing_raid}/1 raid/1 20G")
raise "Failed to create overlay for #{existing_raid}"
end
# Copy base image metadata
if File.exist?("#{existing_raid}/metadata/")
FileUtils.cp_r("#{existing_raid}/metadata/.",
'../metadata/',
verbose: true)
end
end
config[:QEMU_DISABLE_SNAPSHOTS] = true
config[:MAKETESTSNAPSHOTS] = false
......@@ -143,4 +156,11 @@ File.write('live_log', '')
system({ 'QEMU_AUDIO_DRV' => 'none' }, ISOTOVIDEO, '-d') || raise
Dir.chdir('..')
Dir.glob('wok/ulogs/metadata-*') do |file|
target = File.basename(file)
target = target.split('-', 2)[-1]
FileUtils.mv(file, File.join('metadata', target), verbose: true)
end
JUnit.from_openqa('wok/testresults')
......@@ -31,6 +31,9 @@ sub run {
select_console 'log-console';
{
upload_logs '/cdrom/.disk/info', log_name => 'metadata';
upload_logs '/cdrom/casper/filesystem.manifest', log_name => 'metadata';
assert_script_run 'wget ' . data_url('permissions_check.rb'), 16;
assert_script_run 'ruby permissions_check.rb', 16;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment