mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Compass-ci

Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
compass-ci@openeuler.org

December 2020

  • 26 participants
  • 957 discussions
[PATCH v2 compass-ci] user-client/maintain: add '|' for multi args
by Liu Yinsi 04 Dec '20

04 Dec '20
multi args changed from os os_arch os_version to os|os_arch|os_version, and if use os|os_arch|os_version, job yaml must as the first parameter. Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- .../maintain/walk-os-test/walk-os-iperf-test | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/user-client/maintain/walk-os-test/walk-os-iperf-test b/user-client/maintain/walk-os-test/walk-os-iperf-test index ed97999..9f75516 100755 --- a/user-client/maintain/walk-os-test/walk-os-iperf-test +++ b/user-client/maintain/walk-os-test/walk-os-iperf-test @@ -101,8 +101,8 @@ def run_qemu end end -def submit_job(os_str, os_mount) - `submit --my-queue 'os os_arch os_version=#{os_str}' 'testbox=#{TESTBOX}' 'os_mount=#{os_mount}' #{TEST_YAML}` +def submit_job(os_args, os_mount) + `submit #{TEST_YAML} --my-queue 'os|os_arch|os_version=#{os_args}' testbox=#{TESTBOX} os_mount=#{os_mount}` end def traversal_os_mount @@ -113,12 +113,13 @@ end def traversal_test_os(os_mount) TEST_OS.each do |os_str| - test_rootfs(os_str, os_mount) + os_args = os_str.gsub(' ', '|') + test_rootfs(os_args, os_mount) end end -def test_rootfs(os_str, os_mount) - message = submit_job(os_str, os_mount).chomp +def test_rootfs(os_args, os_mount) + message = submit_job(os_args, os_mount).chomp job_id = message.split('=')[1] run_qemu @@ -128,7 +129,7 @@ def test_rootfs(os_str, os_mount) find_by_id(job_id) end - report_all = job_id.split(', ') + os_str.split + os_mount.split + job_result + report_all = job_id.split(', ') + os_args.split + os_mount.split + job_result write_report(report_all) end -- 2.23.0
1 0
0 0
[PATCH compass-ci] change file mode to be the same with others
by Ren Wen 04 Dec '20

04 Dec '20
Signed-off-by: Ren Wen <15991987063(a)163.com> --- src/lib/json_logger.cr | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/lib/json_logger.cr diff --git a/src/lib/json_logger.cr b/src/lib/json_logger.cr old mode 100755 new mode 100644 -- 2.23.0
1 0
0 0
[PATCH compass-ci] scheduler/jobfile_operate.cr: refactor create_job_cpio
by Wu Zhende 04 Dec '20

04 Dec '20
Separate "create_job_cpio" into a new file. Use class Sched, can use Sched's instance variable. Also can simplify jobfile_operate.cr. Signed-off-by: Wu Zhende <wuzhende666(a)163.com> --- src/lib/sched.cr | 1 + src/scheduler/create_job_cpio.cr | 140 +++++++++++++++++++++++++++++++ src/scheduler/find_job_boot.cr | 2 +- src/scheduler/jobfile_operate.cr | 132 ----------------------------- 4 files changed, 142 insertions(+), 133 deletions(-) create mode 100644 src/scheduler/create_job_cpio.cr diff --git a/src/lib/sched.cr b/src/lib/sched.cr index a9f893f..22e0e4e 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -20,6 +20,7 @@ require "../scheduler/find_next_job_boot" require "../scheduler/close_job" require "../scheduler/request_cluster_state" require "../scheduler/update_job_parameter" +require "../scheduler/create_job_cpio" class Sched property es diff --git a/src/scheduler/create_job_cpio.cr b/src/scheduler/create_job_cpio.cr new file mode 100644 index 0000000..5c1be7e --- /dev/null +++ b/src/scheduler/create_job_cpio.cr @@ -0,0 +1,140 @@ +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. + +# shellwords require from '/c/lkp-tests/lib/' +require "shellwords" +require "file_utils" +require "json" +require "yaml" + +require "./jobfile_operate" + +class Sched + private def prepare_dir(file_path : String) + file_path_dir = File.dirname(file_path) + unless File.exists?(file_path_dir) + FileUtils.mkdir_p(file_path_dir) + end + end + + private def valid_shell_variable?(key) + key =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/ + end + + private def create_job_sh(job_sh_content : Array(JSON::Any), path : String) + File.open(path, "w", File::Permissions.new(0o775)) do |file| + file.puts "#!/bin/sh\n\n" + + job_sh_content.each do |line| + if line.as_a? + line.as_a.each { |val| file.puts val } + else + file.puts line + end + end + + file.puts "\"$@\"" + end + end + + private def shell_escape(val) + val = val.join "\n" if val.is_a?(Array) + + if val.nil? || val.empty? + return nil + elsif val =~ /^[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?$/ + return val + elsif !val.includes?("'") && !val.includes?("$") + return "'#{val}'" + elsif !val.includes?('"') + return "\"#{val}\"" + else + return Shellwords.shellescape(val) + end + end + + private def parse_one(script_lines, key, val) + return false if val.as_h? || !valid_shell_variable?(key) + + value = shell_escape(val.as_a? || val.to_s) + script_lines << "\texport #{key}=" + value if value + end + + private def sh_export_top_env(job_content : Hash) + script_lines = ["export_top_env()", "{"] of String + + job_content.each { |key, val| parse_one(script_lines, key, val) } + + script_lines << "\n" + script_lines << "\t[ -n \"$LKP_SRC\" ] ||" + script_lines << "\texport LKP_SRC=/lkp/${user:-lkp}/src" + script_lines << "}\n\n" + + script_lines = script_lines.to_s + script_lines = JSON.parse(script_lines) + end + + def create_job_cpio(job_content : JSON::Any, base_dir : String) + job_content = job_content.as_h + + # put job2sh in an array + if job_content.has_key?("job2sh") + tmp_job_sh_content = job_content["job2sh"] + + job_sh_array = [] of JSON::Any + tmp_job_sh_content.as_h.each do |_key, val| + next if val == nil + job_sh_array += val.as_a + end + else + job_sh_array = [] of JSON::Any + end + + # generate job.yaml + temp_yaml = base_dir + "/#{job_content["id"]}/job.yaml" + prepare_dir(temp_yaml) + + # no change to <object> content { "#! jobs/pixz.yaml": null } + # - this will create a <'#! jobs/pixz.yaml':> in the yaml file + # - but the orange is <#! jobs/pixz.yaml> in the user job.yaml + # tested : no effect to job.sh + File.open(temp_yaml, "w") do |file| + YAML.dump(job_content, file) + end + + # generate unbroken job shell content + sh_export_top_env = sh_export_top_env(job_content) + job_sh_content = sh_export_top_env.as_a + job_sh_array + + # generate job.sh + job_sh = base_dir + "/#{job_content["id"]}/job.sh" + create_job_sh(job_sh_content.to_a, job_sh) + + job_dir = base_dir + "/#{job_content["id"]}" + + if job_sh_array.empty? + lkp_src = Jobfile::Operate.prepare_lkp_tests(job_content["lkp_initrd_user"], + job_content["os_arch"]) + + cmd = "#{lkp_src}/sbin/create-job-cpio.sh #{temp_yaml}" + idd = `#{cmd}` + else + cmd = "./create-job-cpio.sh #{job_dir}" + idd = `#{cmd}` + end + + # if the create job cpio failed, what to do? + puts idd if idd.match(/ERROR/) + + # create result dir and copy job.sh, job.yaml and job.cgz to result dir + src_dir = File.dirname(temp_yaml) + dst_dir = File.join("/srv", job_content["result_root"].to_s) + FileUtils.mkdir_p(dst_dir) + + # the job.yaml is not final version + files = ["#{src_dir}/job.sh", + "#{src_dir}/job.yaml", + "#{src_dir}/job.cgz"] + FileUtils.cp(files, dst_dir) + end +end diff --git a/src/scheduler/find_job_boot.cr b/src/scheduler/find_job_boot.cr index ad48f27..6f51640 100644 --- a/src/scheduler/find_job_boot.cr +++ b/src/scheduler/find_job_boot.cr @@ -75,7 +75,7 @@ class Sched job = get_job_from_queues(queues, host) if job - Jobfile::Operate.create_job_cpio(job.dump_to_json_any, Kemal.config.public_folder) + create_job_cpio(job.dump_to_json_any, Kemal.config.public_folder) end return boot_content(job, boot_type) diff --git a/src/scheduler/jobfile_operate.cr b/src/scheduler/jobfile_operate.cr index 98bf011..df79d3b 100644 --- a/src/scheduler/jobfile_operate.cr +++ b/src/scheduler/jobfile_operate.cr @@ -5,139 +5,7 @@ require "file_utils" require "json" require "yaml" -# require from '/c/lkp-tests/lib/' -require "shellwords" - -LKP_PATH = "/c/lkp-tests" -if ENV["LKP_SRC"] != LKP_PATH - raise "ENV LKP_SRC mismatch: #{ENV["LKP_SRC"]} #{LKP_PATH}" -end - module Jobfile::Operate - def self.prepare_dir(file_path : String) - file_path_dir = File.dirname(file_path) - unless File.exists?(file_path_dir) - FileUtils.mkdir_p(file_path_dir) - end - end - - def self.valid_shell_variable?(key) - key =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/ - end - - def self.create_job_sh(job_sh_content : Array(JSON::Any), path : String) - File.open(path, "w", File::Permissions.new(0o775)) do |file| - file.puts "#!/bin/sh\n\n" - job_sh_content.each do |line| - if line.as_a? - line.as_a.each { |val| file.puts val } - else - file.puts line - end - end - file.puts "\"$@\"" - end - end - - def self.shell_escape(val) - val = val.join "\n" if val.is_a?(Array) - - if val.nil? || val.empty? - return nil - elsif val =~ /^[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?[0-9]+)?$/ - return val - elsif !val.includes?("'") && !val.includes?("$") - return "'#{val}'" - elsif !val.includes?('"') - return "\"#{val}\"" - else - return Shellwords.shellescape(val) - end - end - - def self.parse_one(script_lines, key, val) - return false if val.as_h? || !valid_shell_variable?(key) - - value = shell_escape(val.as_a? || val.to_s) - script_lines << "\texport #{key}=" + value if value - end - - def self.sh_export_top_env(job_content : Hash) - script_lines = ["export_top_env()", "{"] of String - - job_content.each { |key, val| parse_one(script_lines, key, val) } - - script_lines << "\n" - script_lines << "\t[ -n \"$LKP_SRC\" ] ||" - script_lines << "\texport LKP_SRC=/lkp/${user:-lkp}/src" - script_lines << "}\n\n" - - script_lines = script_lines.to_s - script_lines = JSON.parse(script_lines) - end - - def self.create_job_cpio(job_content : JSON::Any, base_dir : String) - job_content = job_content.as_h - - # put job2sh in an array - if job_content.has_key?("job2sh") - tmp_job_sh_content = job_content["job2sh"] - - job_sh_array = [] of JSON::Any - tmp_job_sh_content.as_h.each do |_key, val| - next if val == nil - job_sh_array += val.as_a - end - else - job_sh_array = [] of JSON::Any - end - - # generate job.yaml - temp_yaml = base_dir + "/#{job_content["id"]}/job.yaml" - prepare_dir(temp_yaml) - - # no change to <object> content { "#! jobs/pixz.yaml": null } - # - this will create a <'#! jobs/pixz.yaml':> in the yaml file - # - but the orange is <#! jobs/pixz.yaml> in the user job.yaml - # tested : no effect to job.sh - File.open(temp_yaml, "w") do |file| - YAML.dump(job_content, file) - end - - # generate unbroken job shell content - sh_export_top_env = sh_export_top_env(job_content) - job_sh_content = sh_export_top_env.as_a + job_sh_array - - # generate job.sh - job_sh = base_dir + "/#{job_content["id"]}/job.sh" - create_job_sh(job_sh_content.to_a, job_sh) - - job_dir = base_dir + "/#{job_content["id"]}" - - if job_sh_array.empty? - lkp_src = prepare_lkp_tests(job_content["lkp_initrd_user"], - job_content["os_arch"]) - - cmd = "#{lkp_src}/sbin/create-job-cpio.sh #{temp_yaml}" - idd = `#{cmd}` - else - cmd = "./create-job-cpio.sh #{job_dir}" - idd = `#{cmd}` - end - - # if the create job cpio failed, what to do? - puts idd if idd.match(/ERROR/) - # create result dir and copy job.sh, job.yaml and job.cgz to result dir - src_dir = File.dirname(temp_yaml) - dst_dir = File.join("/srv", job_content["result_root"].to_s) - FileUtils.mkdir_p(dst_dir) - # the job.yaml is not final version - files = ["#{src_dir}/job.sh", - "#{src_dir}/job.yaml", - "#{src_dir}/job.cgz"] - FileUtils.cp(files, dst_dir) - end - def self.unzip_cgz(source_path : String, target_path : String) FileUtils.mkdir_p(target_path) cmd = "cd #{target_path};gzip -dc #{source_path}|cpio -id" -- 2.23.0
1 0
0 0
[PATCH lkp-tests 2/2] lib/common.rb: add build_pkg_error_id function
by Lin Jiaxin 03 Dec '20

03 Dec '20
Signed-off-by: Lin Jiaxin <ljx.joe(a)qq.com> --- lib/common.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/common.rb b/lib/common.rb index 91997baa..cc64eb17 100755 --- a/lib/common.rb +++ b/lib/common.rb @@ -319,3 +319,25 @@ end def delete_file_if_exist(file) File.delete(file) if File.exist?(file) end + +def build_pkg_error_id(line) + line = line.chomp + line = line.gsub(/\b[3-9]\.[0-9]+[-a-z0-9.]+/, "#") # linux version: 3.17.0-next-20141008-g099669ed + line = line.gsub(/\b[1-9][0-9]-[A-Z][a-z]+-[0-9]{4}\b/, "#") # Date: 28-Dec-2013 + line = line.gsub(/\b0x[0-9a-f]+\b/, "#") # hex number + line = line.gsub(/\b[a-f0-9]{40}\b/, "#") # SHA-1 + line = line.gsub(/\b[0-9][0-9.]*/, "#") # number + line = line.gsub(/#x\b/, "0x") + line = line.gsub(/[\\"$]/, "~") + line = line.gsub(/[ \t]/, " ") + line = line.gsub(/\ \ +/, " ") + line = line.gsub(/([^a-zA-Z0-9])\ /, "\\1") + line = line.gsub(/\ ([^a-zA-Z])/, "\\1") + line = line.gsub(/^\ /, "") + line = line.gsub(/^-/, "") + line = line.gsub(/\ _/, "_") + line = line.tr(" ", "-") + line = line.gsub(/[-_.,;:#!\[(]+$/, "") + line = line.gsub(/([-_.,;:#!]){3,}/, ":") + line +end -- 2.23.0
1 0
0 0
[PATCH lkp-tests 1/2] stats/build-pkg: rename common_error_id function and move it to ../lib/common
by Lin Jiaxin 03 Dec '20

03 Dec '20
Signed-off-by: Lin Jiaxin <ljx.joe(a)qq.com> --- stats/build-pkg | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/stats/build-pkg b/stats/build-pkg index 9eef8c91..90f27656 100755 --- a/stats/build-pkg +++ b/stats/build-pkg @@ -1,27 +1,9 @@ #!/usr/bin/env ruby -require 'set' -def common_error_id(line) - line = line.chomp - line = line.gsub(/\b[3-9]\.[0-9]+[-a-z0-9.]+/, "#") # linux version: 3.17.0-next-20141008-g099669ed - line = line.gsub(/\b[1-9][0-9]-[A-Z][a-z]+-[0-9]{4}\b/, "#") # Date: 28-Dec-2013 - line = line.gsub(/\b0x[0-9a-f]+\b/, "#") # hex number - line = line.gsub(/\b[a-f0-9]{40}\b/, "#") # SHA-1 - line = line.gsub(/\b[0-9][0-9.]*/, "#") # number - line = line.gsub(/#x\b/, "0x") - line = line.gsub(/[\\"$]/, "~") - line = line.gsub(/[ \t]/, " ") - line = line.gsub(/\ \ +/, " ") - line = line.gsub(/([^a-zA-Z0-9])\ /, "\\1") - line = line.gsub(/\ ([^a-zA-Z])/, "\\1") - line = line.gsub(/^\ /, "") - line = line.gsub(/^-/, "") - line = line.gsub(/\ _/, "_") - line = line.tr(" ", "-") - line = line.gsub(/[-_.,;:#!\[(]+$/, "") - line = line.gsub(/([-_.,;:#!]){3,}/, ":") - line -end +LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME))) + +require 'set' +require "#{LKP_SRC}/lib/common" error_ids = Set.new in_stderr = false @@ -40,7 +22,7 @@ while (line = STDIN.gets) next unless in_stderr next unless line.downcase =~ /error|warning/ - error_ids << common_error_id(line) + error_ids << build_pkg_error_id(line) end error_ids.each do |id| -- 2.23.0
1 0
0 0
[PATCH compass-ci] lib/error_messages.rb: add obtain_error_messages_by_errorid function
by Lin Jiaxin 03 Dec '20

03 Dec '20
Signed-off-by: Lin Jiaxin <ljx.joe(a)qq.com> --- lib/error_messages.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/error_messages.rb b/lib/error_messages.rb index 7bf3aa8..3a74d29 100644 --- a/lib/error_messages.rb +++ b/lib/error_messages.rb @@ -3,10 +3,13 @@ # frozen_string_literal: true require 'set' +require_relative "#{ENV['LKP_SRC']}/lib/common" # usage: # foo = ErrorMessages.new(build-pkg) # build-pkg is a file that includes errors generated by make +# errorid_array = foo.obtain_error_messages_by_errorid(errorid) +# errorid_array includes all error_messages that error same as errorid # error_messages_hash = foo.obtain_error_messages # error_messages_hash.each { |k,v| puts k; puts; v.each {|m| puts m } } # output: @@ -37,6 +40,17 @@ class ErrorMessages return @error_messages end + def obtain_error_messages_by_errorid(errorid) + error_messages_by_errorid = [] + error_messages = obtain_error_messages + error_messages.each do | k, v | + if ("build-pkg." + build_pkg_error_id(k)) == errorid + error_messages_by_errorid << v + end + end + error_messages_by_errorid + end + private def extract_error_message(line) -- 2.23.0
1 0
0 0
[PATCH compass-ci] user-client/maintain: add '|' for multi args
by Liu Yinsi 03 Dec '20

03 Dec '20
multi args changed from os os_arch os_version to os|os_arch|os_version, and if use os|os_arch|os_version, job yaml must as the first parameter. Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- .../maintain/walk-os-test/walk-os-iperf-test | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/user-client/maintain/walk-os-test/walk-os-iperf-test b/user-client/maintain/walk-os-test/walk-os-iperf-test index ed97999..9f75516 100755 --- a/user-client/maintain/walk-os-test/walk-os-iperf-test +++ b/user-client/maintain/walk-os-test/walk-os-iperf-test @@ -101,8 +101,8 @@ def run_qemu end end -def submit_job(os_str, os_mount) - `submit --my-queue 'os os_arch os_version=#{os_str}' 'testbox=#{TESTBOX}' 'os_mount=#{os_mount}' #{TEST_YAML}` +def submit_job(os_args, os_mount) + `submit #{TEST_YAML} --my-queue 'os|os_arch|os_version=#{os_args}' testbox=#{TESTBOX} os_mount=#{os_mount}` end def traversal_os_mount @@ -113,12 +113,13 @@ end def traversal_test_os(os_mount) TEST_OS.each do |os_str| - test_rootfs(os_str, os_mount) + os_args = os_str.gsub(' ', '|') + test_rootfs(os_args, os_mount) end end -def test_rootfs(os_str, os_mount) - message = submit_job(os_str, os_mount).chomp +def test_rootfs(os_args, os_mount) + message = submit_job(os_args, os_mount).chomp job_id = message.split('=')[1] run_qemu @@ -128,7 +129,7 @@ def test_rootfs(os_str, os_mount) find_by_id(job_id) end - report_all = job_id.split(', ') + os_str.split + os_mount.split + job_result + report_all = job_id.split(', ') + os_args.split + os_mount.split + job_result write_report(report_all) end -- 2.23.0
1 0
0 0
[PATCH lkp-tests] spec/submit_spec.rb: update submit_job
by Hu Xuejiao 03 Dec '20

03 Dec '20
[why] Originally submit_job is too complicated, it needs to be simplified. Signed-off-by: Hu XueJiao <1034502035(a)qq.com> --- spec/submit_spec.rb | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/spec/submit_spec.rb b/spec/submit_spec.rb index 4096cb73..75ad9798 100644 --- a/spec/submit_spec.rb +++ b/spec/submit_spec.rb @@ -16,44 +16,22 @@ end def traverse_file(output_dir) Dir.glob("#{output_dir}/*.yaml").each do |yaml_file| - stable_yaml_file(yaml_file) + stable_yaml_file(yaml_file) unless File.basename(yaml_file) == 'job.yaml' end end -def submit_job(submit_item) - submit_yaml_path = File.join("#{LKP_SRC}/spec/submit", submit_item) - Dir.glob("#{submit_yaml_path}/*.yaml").each do |yaml_file| - output_dir = File.join(submit_yaml_path, File.basename(yaml_file, '.yaml')) +def submit_job() + Dir.glob("#{LKP_SRC}/spec/submit/*").each do |dir| submit_cmd = [ "#{LKP_SRC}/sbin/submit", '-o', output_dir, '-s', 'lab: spec_lab', '-s', 'testbox: vm-2p8g--spec_submit', - yaml_file + "#{dir}/job.yaml" ] system(*submit_cmd) - traverse_file(output_dir) + traverse_file(out_dir) end end -describe 'submit job spec' do - it 'link jobs spec' do - submit_job('link_jobs') - end - - it 'link matrix' do - submit_job('matrix') - end - - it 'separate yaml spec' do - submit_job('separate_yaml') - end - - it 'job on fail' do - submit_job('job_on_fail') - end - - it 'merge yaml' do - submit_job('merge_yaml') - end -end +submit_job -- 2.23.0
1 0
0 0
[PATCH compass-ci] src/scheduler: delete job2sh field in job.yaml
by Zhang Yu 03 Dec '20

03 Dec '20
Signed-off-by: Zhang Yu <2134782174(a)qq.com> --- src/scheduler/jobfile_operate.cr | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/scheduler/jobfile_operate.cr b/src/scheduler/jobfile_operate.cr index 98bf011..82ed885 100644 --- a/src/scheduler/jobfile_operate.cr +++ b/src/scheduler/jobfile_operate.cr @@ -80,16 +80,13 @@ module Jobfile::Operate job_content = job_content.as_h # put job2sh in an array - if job_content.has_key?("job2sh") - tmp_job_sh_content = job_content["job2sh"] - - job_sh_array = [] of JSON::Any + job_sh_array = [] of JSON::Any + tmp_job_sh_content = job_content.delete("job2sh") + if tmp_job_sh_content tmp_job_sh_content.as_h.each do |_key, val| next if val == nil job_sh_array += val.as_a end - else - job_sh_array = [] of JSON::Any end # generate job.yaml -- 2.23.0
2 2
0 0
[PATCH v2 lkp-tests] tests/build-pkg: fix upload in container
by Wang Yong 03 Dec '20

03 Dec '20
docker can not use mount operation, so now use curl to upload build-pkg cgz file Signed-off-by: Wang Yong <wangyong0117(a)qq.com> --- tests/build-pkg | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/build-pkg b/tests/build-pkg index cde2f0edd..38d8bace9 100755 --- a/tests/build-pkg +++ b/tests/build-pkg @@ -18,6 +18,8 @@ ## See: https://wiki.archlinux.org/index.php/Makepkg . $LKP_SRC/lib/debug.sh +. $LKP_SRC/lib/env.sh +. $LKP_SRC/distro/common check_vars() { @@ -29,6 +31,13 @@ check_vars() [ -n "$os_mount" ] || die "os_mount is empty" } +mount_pkg_mnt() +{ + [ -n "$LKP_SERVER" ] && { + mount -t cifs -o guest,vers=1.0,noacl,nouser_xattr,port=446 //$LKP_SERVER$PKG_MNT $PKG_MNT || die "Failed to run mount" + } +} + mount_dest() { # the same image is mounted to cifs and nfs, the generated cgz files @@ -39,9 +48,7 @@ mount_dest() PKG_MNT=/initrd/build-pkg mkdir -p "$PKG_MNT" - [ -n "$LKP_SERVER" ] && { - mount -t cifs -o guest,vers=1.0,noacl,nouser_xattr,port=446 //$LKP_SERVER$PKG_MNT $PKG_MNT || die "Failed to run mount" - } + is_docker || mount_pkg_mnt } get_pkgfile() @@ -139,10 +146,15 @@ build_source_pkg() replace_tar_source cgz_name="$PKG_MNT/${pack_to}/${pkgname}/${upstream_commit}.cgz" + PACMAN=true BUILDDIR=$TMP CARCH=$os_arch PKGEXT=.cgz CGZDEST="$cgz_name" \ $LKP_SRC/sbin/makepkg -A --check --skippgpcheck --config $LKP_SRC/etc/makepkg.conf 2>&1 - [ "$?" == 0 ] && create_softlink + [ "$?" == 0 ] || exit 1 + create_softlink + + is_docker || exit 0 + upload_to_target_dir ${PKG_MNT}/${pack_to}/${pkgname} } check_vars -- 2.23.0
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • ...
  • 96
  • Older →

HyperKitty Powered by HyperKitty