From c3c42c8e83050c9a9116824990e9b0f9e5f876b3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 10 Feb 2021 09:49:54 +0000 Subject: [PATCH] Add benchmarking test scripts. --- 2021-pipelines/.gitignore | 2 ++ 2021-pipelines/benchmarking/create.sh | 13 +++++++++++++ 2021-pipelines/benchmarking/settings.sh | 5 +++++ 2021-pipelines/benchmarking/testA4.sh | 9 +++++++++ 2021-pipelines/benchmarking/testA5.sh | 8 ++++++++ 2021-pipelines/benchmarking/testA6.sh | 19 +++++++++++++++++++ 2021-pipelines/benchmarking/testB4.sh | 11 +++++++++++ 7 files changed, 67 insertions(+) create mode 100644 2021-pipelines/.gitignore create mode 100755 2021-pipelines/benchmarking/create.sh create mode 100644 2021-pipelines/benchmarking/settings.sh create mode 100755 2021-pipelines/benchmarking/testA4.sh create mode 100755 2021-pipelines/benchmarking/testA5.sh create mode 100755 2021-pipelines/benchmarking/testA6.sh create mode 100755 2021-pipelines/benchmarking/testB4.sh diff --git a/2021-pipelines/.gitignore b/2021-pipelines/.gitignore new file mode 100644 index 0000000..ec5fe0c --- /dev/null +++ b/2021-pipelines/.gitignore @@ -0,0 +1,2 @@ +benchmarking/local.img +*.qcow2 \ No newline at end of file diff --git a/2021-pipelines/benchmarking/create.sh b/2021-pipelines/benchmarking/create.sh new file mode 100755 index 0000000..ee5bb1d --- /dev/null +++ b/2021-pipelines/benchmarking/create.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -x +set -e + +source settings.sh + +file=$dir/fedora-33.img + +virt-builder fedora-33 --size 32G -o $file +virt-customize -a $file \ + --run-command 'dd if=/dev/urandom of=/var/tmp/big bs=1M count=3000 && + sync && + rm /var/tmp/big' diff --git a/2021-pipelines/benchmarking/settings.sh b/2021-pipelines/benchmarking/settings.sh new file mode 100644 index 0000000..28f87f1 --- /dev/null +++ b/2021-pipelines/benchmarking/settings.sh @@ -0,0 +1,5 @@ +export LIBGUESTFS_BACKEND=direct + +remote=kool +dir=/mnt/scratch/pipes +ova=$HOME/test.ova diff --git a/2021-pipelines/benchmarking/testA4.sh b/2021-pipelines/benchmarking/testA4.sh new file mode 100755 index 0000000..88085d0 --- /dev/null +++ b/2021-pipelines/benchmarking/testA4.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -x +set -e + +source settings.sh + +qemu-img create -f qcow2 -b ssh://$remote/$dir/fedora-33.img snapshot.qcow2 +virt-sparsify --inplace snapshot.qcow2 +qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img diff --git a/2021-pipelines/benchmarking/testA5.sh b/2021-pipelines/benchmarking/testA5.sh new file mode 100755 index 0000000..9e6260c --- /dev/null +++ b/2021-pipelines/benchmarking/testA5.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -x +set -e + +source settings.sh + +qemu-img create -f qcow2 -b ssh://$remote/$dir/fedora-33.img snapshot.qcow2 +qemu-img convert -f qcow2 snapshot.qcow2 -O raw local.img diff --git a/2021-pipelines/benchmarking/testA6.sh b/2021-pipelines/benchmarking/testA6.sh new file mode 100755 index 0000000..e19dca2 --- /dev/null +++ b/2021-pipelines/benchmarking/testA6.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -x +set -e + +source settings.sh + +nbdkit -f --exit-with-parent --filter=cow ssh host=$remote $dir/fedora-33.img & +sleep 1 +guestfish <