From ee786845213edea488c9a2f8e50bb96a75479965 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 22 Mar 2018 11:53:43 +1100 Subject: [PATCH] Test growroot in boot tests Test that we see the root partition grow. Increase the root disk size to 5gb, and check that the booted vm has grown the disk to at least that. Add disk size tracking so we can more clearly see what's being built into the images. Change-Id: I377beffc4896e03f0c2d01c0061c5f8652e8b1d1 Signed-off-by: Paul Belanger --- devstack/plugin.sh | 27 ++++++++++++++++++++++++--- tools/check_devstack_plugin.sh | 14 ++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 253d5fe53..c8d2957c5 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -383,12 +383,14 @@ diskimages: - centos-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_DEV_USER_AUTHORIZED_KEYS: $NODEPOOL_PUBKEY $DIB_DISTRIBUTION_MIRROR_CENTOS @@ -403,6 +405,7 @@ diskimages: - debian-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -410,6 +413,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' @@ -428,6 +432,7 @@ diskimages: - debian-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -435,6 +440,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' @@ -451,6 +457,7 @@ diskimages: - fedora-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -458,6 +465,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_DEV_USER_AUTHORIZED_KEYS: $NODEPOOL_PUBKEY $DIB_GET_PIP @@ -471,6 +479,7 @@ diskimages: - ubuntu-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -478,6 +487,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' @@ -496,6 +506,7 @@ diskimages: - ubuntu-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -503,6 +514,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' @@ -521,6 +533,7 @@ diskimages: - ubuntu-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -528,6 +541,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_APT_LOCAL_CACHE: '0' DIB_DISABLE_APT_CLEANUP: '1' @@ -546,6 +560,7 @@ diskimages: - opensuse-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -553,6 +568,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_DEV_USER_AUTHORIZED_KEYS: $NODEPOOL_PUBKEY $DIB_GET_PIP @@ -566,6 +582,7 @@ diskimages: - opensuse-minimal - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup @@ -573,6 +590,7 @@ diskimages: env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_DEV_USER_AUTHORIZED_KEYS: $NODEPOOL_PUBKEY $DIB_GET_PIP @@ -586,12 +604,14 @@ diskimages: - gentoo - vm - simple-init + - growroot - devuser - openssh-server - nodepool-setup env-vars: TMPDIR: $NODEPOOL_DIB_BASE_PATH/tmp DIB_CHECKSUM: '1' + DIB_SHOW_IMAGE_USAGE: '1' DIB_IMAGE_CACHE: $NODEPOOL_DIB_BASE_PATH/cache DIB_DEV_USER_AUTHORIZED_KEYS: $NODEPOOL_PUBKEY $DIB_GET_PIP @@ -635,13 +655,14 @@ function configure_nodepool { } function start_nodepool { - # build a custom flavor that's more friendly to nodepool + # build a custom flavor that's more friendly to nodepool; give + # disks a little room to grow local available_flavors=$(nova flavor-list) if [[ ! ( $available_flavors =~ 'nodepool-512' ) ]]; then - nova flavor-create nodepool-512 64 512 0 1 + nova flavor-create nodepool-512 64 512 5 1 fi if [[ ! ( $available_flavors =~ 'nodepool-1024' ) ]]; then - nova flavor-create nodepool-1024 128 1024 0 1 + nova flavor-create nodepool-1024 128 1024 5 1 fi # build sec group rules to reach the nodes, we need to do this diff --git a/tools/check_devstack_plugin.sh b/tools/check_devstack_plugin.sh index b97aa58e0..a3059c33a 100755 --- a/tools/check_devstack_plugin.sh +++ b/tools/check_devstack_plugin.sh @@ -2,6 +2,9 @@ LOGDIR=$1 +# Set to indiciate an error return +RETURN=0 + NODEPOOL_INSTALL=${NODEPOOL_INSTALL:-/opt/stack/nodepool-venv} NODEPOOL_CONFIG=${NODEPOOL_CONFIG:-/etc/nodepool/nodepool.yaml} NODEPOOL_SECURE=${NODEPOOL_SECURE:-/etc/nodepool/secure.conf} @@ -32,6 +35,15 @@ function sshintonode { node=`$NODEPOOL list | grep $name | grep $state | cut -d '|' -f6 | tr -d ' '` /tmp/ssh_wrapper $node ls / + + # Check that the root partition grew on boot; it should be a 5GiB + # partition, but subtract some space for boot region. + root_size=$(/tmp/ssh_wrapper $node -- lsblk -rbno SIZE /dev/vda1) + expected_root_size=$(( (5 * 1024 * 1024 * 1024) - ( 2048 * 1024 ) )) + if [[ $root_size -lt $expected_root_size ]]; then + echo "Root device does not appear to have grown: $root_size" + RETURN=1 + fi } function waitforimage { @@ -153,3 +165,5 @@ $NODEPOOL delete --now 0000000000 # show the deleted nodes (and their replacements may be building) $NODEPOOL list + +exit $RETURN