mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-13 01:46:14 +00:00
6d59786363
Make use of GitLab-CI nested virutal environment to start QEMU instance inside containers and perform btrfs-progs build, execute unit test cases and save the logs. This allows to run the progs testsuite on a recent kernel, newer than what CI instances usually provide. As this is is emulated, the runtime is longer. Issue: #171 Signed-off-by: Lakshmipathi.G <lakshmipathi.ganapathi@collabora.com> Signed-off-by: David Sterba <dsterba@suse.com>
38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Build or Run btrfs-progs tests.
|
|
|
|
set -x
|
|
|
|
BTRFS_BIN="btrfs"
|
|
MNT_DIR="/mnt/"
|
|
BUILD_DIR="/btrfs/"
|
|
test_cmd=$(cat ${MNT_DIR}/cmd)
|
|
|
|
rm -f ${MNT_DIR}/result
|
|
${BTRFS_BIN} --version
|
|
|
|
if [ $? -ne 0 ]
|
|
then
|
|
echo "=========================== Builb btrfs-progs ================"
|
|
echo " Image doesn't have ${BTRFS_BIN} - start build process"
|
|
cd ${MNT_DIR} && ./autogen.sh && ./configure --disable-documentation --disable-backtrace && make -j`nproc` && make install && make testsuite
|
|
echo "================= Prepare Testsuite =========================="
|
|
mkdir -p ${BUILD_DIR}
|
|
cp tests/btrfs-progs-tests.tar.gz ${BUILD_DIR}
|
|
poweroff
|
|
else
|
|
echo "================= Run Tests ================================="
|
|
cd ${BUILD_DIR} && tar -xvf btrfs-progs-tests.tar.gz && ${test_cmd}
|
|
|
|
# check test result status
|
|
if [ $? -ne 0 ]; then
|
|
cd ${BUILD_DIR} && cp *tests-results.txt ${MNT_DIR}
|
|
poweroff
|
|
else
|
|
cd ${BUILD_DIR} && cp *tests-results.txt ${MNT_DIR}
|
|
touch ${MNT_DIR}/result
|
|
poweroff
|
|
fi
|
|
fi
|