tests: Use custom kernel for all tests

This should reduce the integration testing time considerably. When a
custom kernel is no longer required we can pull kernel from tarball
again.

Fixes: #100

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2019-07-16 11:12:53 +01:00 committed by Samuel Ortiz
parent 3cc6f48c31
commit ebe04f6db9
2 changed files with 8 additions and 24 deletions

View File

@ -40,38 +40,22 @@ if [ ! -f "$OS_RAW_IMAGE" ]; then
popd
fi
# Build generic kernel
# Build custom kernel based on virtio-pmem and virtio-fs upstream patches
VMLINUX_IMAGE="$WORKLOADS_DIR/vmlinux"
BZIMAGE_IMAGE="$WORKLOADS_DIR/bzImage"
if [ ! -f "$VMLINUX_IMAGE" ]; then
SRCDIR=$PWD
pushd $WORKLOADS_DIR
wget --quiet https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.0.21.tar.xz
tar xf linux-5.0.21.tar.xz
pushd linux-5.0.21
cp $SRCDIR/resources/linux-5.0-config .config
make bzImage -j `nproc`
cp vmlinux $VMLINUX_IMAGE
cp arch/x86/boot/bzImage $BZIMAGE_IMAGE
popd
rm linux-5.0.21.tar.xz
rm -r linux-5.0.21
popd
fi
# Build custom kernel based on virtio-pmem and virtio-fs upstream patches
VMLINUX_CUSTOM_IMAGE="$WORKLOADS_DIR/vmlinux-custom"
LINUX_CUSTOM_DIR="linux-custom"
if [ ! -f "$VMLINUX_CUSTOM_IMAGE" ]; then
if [ ! -f "$VMLINUX_IMAGE" ]; then
SRCDIR=$PWD
pushd $WORKLOADS_DIR
git clone --depth 1 "https://github.com/sboeuf/linux.git" -b "virtio-pmem_and_virtio-fs" $LINUX_CUSTOM_DIR
pushd $LINUX_CUSTOM_DIR
cp $SRCDIR/resources/linux-virtio-pmem-and-virtio-fs-config .config
make bzImage -j `nproc`
cp vmlinux $VMLINUX_CUSTOM_IMAGE
cp vmlinux $VMLINUX_IMAGE
cp arch/x86/boot/bzImage $BZIMAGE_IMAGE
popd
rm -r $LINUX_CUSTOM_DIR
popd

View File

@ -733,7 +733,7 @@ mod tests {
workload_path.push("workloads");
let mut kernel_path = workload_path.clone();
kernel_path.push("vmlinux-custom");
kernel_path.push("vmlinux");
let mut child = Command::new("target/debug/cloud-hypervisor")
.args(&["--cpus", "1"])
@ -788,7 +788,7 @@ mod tests {
workload_path.push("workloads");
let mut kernel_path = workload_path.clone();
kernel_path.push("vmlinux-custom");
kernel_path.push("vmlinux");
let pmem_backend_path = guest.tmp_dir.path().join("/tmp/pmem-file");
let mut pmem_backend_file = OpenOptions::new()
@ -868,7 +868,7 @@ mod tests {
workload_path.push("workloads");
let mut kernel_path = workload_path.clone();
kernel_path.push("vmlinux-custom");
kernel_path.push("vmlinux");
let mut child = Command::new("target/debug/cloud-hypervisor")
.args(&["--cpus", "1"])