[purpose] Verify that a local job can be consumed properly
Signed-off-by: Hu XueJiao 1034502035@qq.com --- sbin/run_job | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 sbin/run_job
diff --git a/sbin/run_job b/sbin/run_job new file mode 100755 index 00000000..d45571b3 --- /dev/null +++ b/sbin/run_job @@ -0,0 +1,74 @@ +#!/bin/bash + +cci_makepkg_file="$LKP_SRC/jobs/cci-makepkg.yaml" +grep "atomic" $cci_makepkg_file || sed -i 's|benchmark:|& atomic|g' $cci_makepkg_file + +submit_one_job() +{ + cmd=( + submit -m $yaml + os=${single_arg[0]} + os_arch=${single_arg[1]} + os_version=${single_arg[2]} + os_mount=${single_arg[3]} + testbox=$testbox + queue="$tbox_group.$HOSTNAME" + ) + echo ${cmd[@]} + output=$("${cmd[@]}") + echo "$output" | grep -o -E 'job_state=finished[^"]*' +} + +submit_job() +{ + yaml_args=("$cci_makepkg_file" "host-info.yaml") + for yaml in "${yaml_args[@]}" + do + submit_one_job & + done +} + +run_qemu() +{ + local nr_vm=4 + local testbox="vm-2p8g" + local tbox_group="vm-2p8g" + local hostname=$tbox_group.$HOSTNAME + local queues="$tbox_group.$HOSTNAME" + + $CCI_SRC/providers/multi-qemu -n "$hostname" -c "$nr_vm" -q "$queues" + + qemu_args=( + "openeuler aarch64 20.03 cifs" + "centos aarch64 7.6.1810 initramfs" + ) + for qemu_arg in "${qemu_args[@]}" + do + local single_arg=($(echo $qemu_arg)) + submit_job + done +} + +run_docker() +{ + local nr_container=2 + local tbox_group="dc-8g" + local testbox="dc-8g" + local hostname=$tbox_group.$HOSTNAME + local queues="$tbox_group.$HOSTNAME" + + $CCI_SRC/providers/multi-docker -n $hostname -c $nr_container -q $queues + + docker_args=( + "centos aarch64 7.6.1810 container" + ) + for docker_arg in "${docker_args[@]}" + do + local single_arg=($(echo $docker_arg)) + submit_job + done +} + +run_qemu +run_docker +wait
The title is like: bin/run_job => sbin/run_job
Thanks, Liushaofei
On Thu, Dec 24, 2020 at 05:17:39PM +0800, Hu Xuejiao wrote:
[purpose] Verify that a local job can be consumed properly
Signed-off-by: Hu XueJiao 1034502035@qq.com
sbin/run_job | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 sbin/run_job
diff --git a/sbin/run_job b/sbin/run_job new file mode 100755 index 00000000..d45571b3 --- /dev/null +++ b/sbin/run_job @@ -0,0 +1,74 @@ +#!/bin/bash
+cci_makepkg_file="$LKP_SRC/jobs/cci-makepkg.yaml" +grep "atomic" $cci_makepkg_file || sed -i 's|benchmark:|& atomic|g' $cci_makepkg_file
+submit_one_job() +{
- cmd=(
submit -m $yaml
os=${single_arg[0]}
os_arch=${single_arg[1]}
os_version=${single_arg[2]}
os_mount=${single_arg[3]}
testbox=$testbox
queue="$tbox_group.$HOSTNAME"
- )
- echo ${cmd[@]}
- output=$("${cmd[@]}")
- echo "$output" | grep -o -E 'job_state=finished[^"]*'
+}
+submit_job() +{
- yaml_args=("$cci_makepkg_file" "host-info.yaml")
- for yaml in "${yaml_args[@]}"
- do
submit_one_job &
- done
+}
+run_qemu() +{
- local nr_vm=4
- local testbox="vm-2p8g"
- local tbox_group="vm-2p8g"
- local hostname=$tbox_group.$HOSTNAME
- local queues="$tbox_group.$HOSTNAME"
- $CCI_SRC/providers/multi-qemu -n "$hostname" -c "$nr_vm" -q "$queues"
- qemu_args=(
"openeuler aarch64 20.03 cifs"
"centos aarch64 7.6.1810 initramfs"
)
- for qemu_arg in "${qemu_args[@]}"
- do
local single_arg=($(echo $qemu_arg))
submit_job
- done
+}
+run_docker() +{
- local nr_container=2
- local tbox_group="dc-8g"
- local testbox="dc-8g"
- local hostname=$tbox_group.$HOSTNAME
- local queues="$tbox_group.$HOSTNAME"
- $CCI_SRC/providers/multi-docker -n $hostname -c $nr_container -q $queues
- docker_args=(
"centos aarch64 7.6.1810 container"
)
- for docker_arg in "${docker_args[@]}"
- do
local single_arg=($(echo $docker_arg))
submit_job
- done
+}
+run_qemu +run_docker
+wait
2.23.0