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 <pabelanger@redhat.com>
This commit is contained in:
Ian Wienand 2018-03-22 11:53:43 +11:00 committed by Paul Belanger
parent 26460e26f2
commit ee78684521
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
2 changed files with 38 additions and 3 deletions

View File

@ -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

View File

@ -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