mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Corrections to two test testing tool (#1276)
Ensure the two disk test tool is used to ensure any tweaks to the format made to the script are exercised.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
VAGRANT_HOME=${1:-$HOME/.vagrant.d/}
|
||||
VAGRANT_CMD=${2:-vagrant}
|
||||
@@ -6,22 +9,24 @@ echo 'Create box with two disks'
|
||||
${VAGRANT_CMD} box list
|
||||
if [ "$(${VAGRANT_CMD} box list | grep -c -E '^infernix/tinycore-two-disks\s')" -eq 0 ]
|
||||
then
|
||||
${VAGRANT_CMD} box list
|
||||
if [ "$(${VAGRANT_CMD} box list | grep -c -E '^infernix/tinycore\s')" -eq 0 ]
|
||||
then
|
||||
${VAGRANT_CMD} box add infernix/tinycore
|
||||
fi
|
||||
NEW_PATH="${VAGRANT_HOME}/boxes/infernix-VAGRANTSLASH-tinycore-two-disks"
|
||||
cp -r "${VAGRANT_HOME}/boxes/infernix-VAGRANTSLASH-tinycore" "${NEW_PATH}"
|
||||
BOX_VERSION="$(${VAGRANT_CMD} box list --machine-readable | grep -A 10 infernix/tinycore-two-disks | grep box-version | cut -d, -f4)"
|
||||
BOX_VERSION="$(${VAGRANT_CMD} box list --machine-readable | grep -A 10 infernix/tinycore-two-disks | grep box-version | head -n 1 | cut -d, -f4)"
|
||||
qemu-img create -f qcow2 "${NEW_PATH}/${BOX_VERSION}/libvirt/disk2.qcow2" 10G
|
||||
cat > "${NEW_PATH}/${BOX_VERSION}/libvirt/metadata.json" <<EOF
|
||||
{
|
||||
"provider": "libvirt",
|
||||
"disks" : [
|
||||
{
|
||||
"path": "box.img"
|
||||
},
|
||||
{
|
||||
"path":"disk2.qcow2",
|
||||
"path": "disk2.qcow2"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user