This function has been implemented in compass-ci/container/defconfig.rb.
The "/etc" and "/home" has been loaded by "load_self_config" in "lkp-tests/lib/job.rb".
Do you still need the function?
I copied the funtion from "defconfig.rb". It's different from "load_self_config".
Thanks, RenWen
Thanks, Xueliang
def valid_shell_variable?(key) key =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/ end diff --git a/sbin/submit b/sbin/submit index 39cdcf576..e9e10d903 100755 --- a/sbin/submit +++ b/sbin/submit @@ -17,6 +17,7 @@ opt_auto_define_files = false opt_monitor = false opt_monitor_query = {} opt_my_queue = false +opt_upload_files = [] actions = ['output', 'stop']
options = OptionParser.new do |opts| @@ -64,10 +65,40 @@ options = OptionParser.new do |opts| opt_my_queue = true end
- opts.on('-f FILE', '--upload-file FILE', "upload an XML template of libvirt. File: *.xml") do |file|
- unless File.exist? file
puts "Find no file: #{file}"
exit 1
- end
- opt_upload_files << file
- end
end
options.parse!(ARGV)
+def upload_configs(files)
- defaults = cci_defaults()
- upload_host = defaults['LKP_SERVER']
- upload_port = defaults['UPLOAD_LIBVIRT_PORT'] || 3081
- files.each do |file|
- response = `curl -sSf -T #{file} http://#%7Bupload_host%7D:#%7Bupload_port%7D/%60
- if $? == 0
puts response
- else
# TODO: how to deal with uploaded file when one failing
puts response
exit 1
- end
- end
- exit 0
+end
+upload_configs(opt_upload_files)
seen_job_yaml = false ARGV.delete_if do |arg| if arg.index '=' -- 2.23.0