Merge "Add functional test for ironic-agent on Fedora"
This commit is contained in:
commit
8e3f01fe82
0
elements/ironic-agent/test-elements/README.rst
Normal file
0
elements/ironic-agent/test-elements/README.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
fedora
|
@ -0,0 +1 @@
|
|||||||
|
ramdisk
|
@ -0,0 +1,2 @@
|
|||||||
|
# Pin to this mirror because the roundrobin is fairly unreliable
|
||||||
|
export DIB_DISTRIBUTION_MIRROR=http://dl.fedoraproject.org/pub/fedora/linux
|
@ -10,6 +10,10 @@ for test_element in $basedir/../elements/*/test-elements/*; do
|
|||||||
if [ -d "$test_element" ]; then
|
if [ -d "$test_element" ]; then
|
||||||
# our element name is two dirs up
|
# our element name is two dirs up
|
||||||
element_name=$(basename $(dirname $(dirname $test_element)))
|
element_name=$(basename $(dirname $(dirname $test_element)))
|
||||||
run_element_test "$(basename $test_element)" "$element_name"
|
element_type=disk
|
||||||
|
if [ -f "$test_element/element-type" ]; then
|
||||||
|
element_type=$(cat "$test_element/element-type")
|
||||||
|
fi
|
||||||
|
run_${element_type}_element_test "$(basename $test_element)" "$element_name"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -45,7 +45,7 @@ function build_test_image() {
|
|||||||
docker rmi $base_dest/image
|
docker rmi $base_dest/image
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_element_test() {
|
function run_disk_element_test() {
|
||||||
test_element=$1
|
test_element=$1
|
||||||
element=$2
|
element=$2
|
||||||
|
|
||||||
@ -81,3 +81,26 @@ function run_element_test() {
|
|||||||
trap EXIT
|
trap EXIT
|
||||||
rm -rf $dest_dir /tmp/dib-test-should-fail
|
rm -rf $dest_dir /tmp/dib-test-should-fail
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function run_ramdisk_element_test() {
|
||||||
|
test_element=$1
|
||||||
|
element=$2
|
||||||
|
|
||||||
|
dest_dir=$(mktemp -d)
|
||||||
|
|
||||||
|
if ELEMENTS_PATH=$DIB_ELEMENTS/$element/test-elements \
|
||||||
|
$DIB_CMD -o $dest_dir/image $element $test_element; then
|
||||||
|
# TODO(dtantsur): test also kernel presence once we sort out its naming
|
||||||
|
# problem (vmlinuz vs kernel)
|
||||||
|
if ! [ -f "$dest_dir/image.initramfs" ]; then
|
||||||
|
echo "Error: Build failed for element: $element, test-element: $test_element."
|
||||||
|
echo "No image $dest_dir/image.initramfs found!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "PASS: Element $element, test-element: $test_element"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Error: Build failed for element: $element, test-element: $test_element."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user