Fix archzfs-qemu-git-test-00-bootfs

extramodules
Jesus Alvarez 8 years ago
parent d394bdee9c
commit fe21e760f1
  1. 16
      repo.sh
  2. 6
      testing/README.rst
  3. 4
      testing/test.sh
  4. 8
      testing/tests/archzfs-qemu-base/setup.sh
  5. 52
      testing/tests/archzfs-qemu-git-test-00-bootfs/README.rst
  6. 2
      testing/tests/archzfs-qemu-git-test-00-bootfs/archiso.sh
  7. 4
      testing/tests/archzfs-qemu-git-test-00-bootfs/conf.sh
  8. 4
      testing/tests/archzfs-qemu-git-test-00-bootfs/pacman.sh
  9. 2
      testing/tests/archzfs-qemu-lts-test-00-bootfs/archiso.sh
  10. 4
      testing/tests/archzfs-qemu-lts-test-00-bootfs/conf.sh
  11. 3
      testing/tests/archzfs-qemu-lts-test-00-bootfs/pacman.sh
  12. 2
      testing/tests/archzfs-qemu-std-test-00-bootfs/archiso.sh
  13. 4
      testing/tests/archzfs-qemu-std-test-00-bootfs/conf.sh
  14. 3
      testing/tests/archzfs-qemu-std-test-00-bootfs/pacman.sh
  15. 2
      testing/tests/archzfs-qemu-std-test-00-default/archiso.sh
  16. 4
      testing/tests/archzfs-qemu-std-test-00-default/conf.sh
  17. 3
      testing/tests/archzfs-qemu-std-test-00-default/pacman.sh

@ -13,6 +13,7 @@ repo_name="" # The destination repo for the packages
package_list=() # A list of packages to add. Array items are in the form of "name;pkg.tar.xz;repo_path".
package_src_list=() # A list of package sources to move
package_exist_list=()
haz_error=0
if ! source ${script_dir}/lib.sh; then
@ -128,8 +129,17 @@ repo_package_list() {
fi
debug "Version match check: arch: ${arch} name: ${name} vers: ${vers} vers_match: ${match}"
if ! [[ ${vers} =~ ^${match} ]]; then
if ! [[ ${vers} =~ ^${match} ]] ; then
debug "Version mismatch!"
if [[ ${name} =~ .*-git ]]; then
error "Attempting to add Git packages that are out of date!"
error "package version from filesystem: ${vers}"
error "calculated version from git: ${match}"
haz_error=1
if [[ ${dry_run} -ne 1 ]]; then
exit 1
fi
fi
continue
fi
@ -260,3 +270,7 @@ for func in ${update_funcs[@]}; do
repo_package_backup
repo_add
done
if [[ ${haz_error} -ne 0 ]]; then
warning "An error has been detected! Inspect output above closely..."
fi

@ -1,7 +1,7 @@
=====================
archzfs testing guide
=====================
:Modified: Sat Sep 17 00:43 2016
:Modified: Sun Jan 29 14:08 2017
--------
Overview
@ -229,8 +229,8 @@ If all of these criteria are met, the test is a success.
Another key area I am going to look at is the changes made to the systemd scripts reported by bronek via
https://github.com/archzfs/archzfs/issues/72. How will these changes impact
Deployng the archzfs-linux packages to the archzfs-testing repo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Deploying the archzfs-linux packages to the archzfs-testing repo
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This is the easiest part, all that needed to be done was to increment the version number in `src/kernels/linux.sh` and build
using `./build.sh std update make -u -U` once this was done the packages were added to the `archzfs-testing` repo using

@ -63,8 +63,8 @@ archiso_build() {
archiso_init_vars() {
export archiso_iso_name=$(find ${packer_work_dir}/ -iname "archlinux*.iso" | xargs basename)
export archiso_sha=$(sha1sum ${packer_work_dir}/${archiso_iso_name} | awk '{ print $1 }')
export archiso_iso_name=$(find ${packer_work_dir}/ -iname "archlinux*.iso" | xargs basename 2> /dev/null )
export archiso_sha=$(sha1sum ${packer_work_dir}/${archiso_iso_name} 2> /dev/null | awk '{ print $1 }')
export archiso_url="${packer_work_dir}/${archiso_iso_name}"
debug "archiso_iso_name=${archiso_iso_name}"
debug "archiso_sha=${archiso_sha}"

@ -10,6 +10,10 @@ if ! source ${script_dir}/lib.sh; then
fi
export debug_flag=1
export dry_run=0
# source_safe "${script_dir}/archzfs-conf.sh"
source_safe "${script_dir}/test-conf.sh"
source_safe "${script_dir}/test-archiso.sh"
@ -20,10 +24,6 @@ source_safe "${script_dir}/test-hooks.sh"
source_safe "${script_dir}/test-pacman.sh"
export debug_flag=1
export dry_run=0
# Install nfs mount points to the archiso environment
test_fs_config_nfs

@ -1,52 +0,0 @@
=========================================
Test archzfs-qemu-lts-test-01-root-bootfs
=========================================
Tests all the steps required for archzfs-linux-lts to be used as a boot filesystem.
--------
Overview
--------
Builds a custom archiso with the linux-lts kernel used by packer to create a Qemu base image. Syslinux is used as the boot
loader.
---
How
---
1. The archzfs-linux-lts packages are built for the linux-lts kernel and added to a package repository named "archzfs-testing".
#. The archzfs-testing repo is shared over NFS.
#. A custom archiso is built that boots into the linux-lts kernel. See `Archiso customization`_
#. The test files are compressed into a tar archive.
#. Packer is used to build a qemu base image using the custom archiso.
#. `setup.sh` is ran in the archiso to install arch on ZFS.
#. After installation of Arch on ZFS, the VM is rebooted and packer finalizes the base image.
#. The qemu base image created by packer is booted, if the boot is successful, the test is considered passed.
---------------------
Archiso customization
---------------------
At the time of putting this test together (2016.09.03), there was no stable ZFSonLinux release that supported kernel 4.7 and
the archiso release at the time shipped with kernel 4.7. In order to install Arch on ZFS for test, I needed an archiso with
the linux-lts kernel. Thus, the archzfs-archiso was born!
The archiso is built by `test.sh` and used by packer to create a Qemu base image with ZFS as the root filesystem for testing.
The archiso comes with a bunch of features that are not needed in test, so they have been stripped out or modified. This
includes:
* boot straight into the linux-lts kernel to speed up the testing cycle.
* ZFS does not support arch-i686, so it was stripped.
* iPXE was not needed.
The archiso sources are copied from `/usr/share/archiso/configs/releng` after installation of the "archiso" package. The
modifed code is contained in the `testing/archiso-linux-lts` directory of this project.

@ -6,7 +6,7 @@ test_build_archiso() {
run_cmd "rm -rf ${test_root_dir}/archiso/out/archlinux*"
fi
run_cmd "./build.sh -v"
msg2 "Coping archiso to packer_work_dir"
msg2 "Copying archiso to packer_work_dir"
run_cmd "cp ${test_root_dir}/../../../archiso/out/archlinux* ${packer_work_dir} && rm -rf ${test_root_dir}/archiso/work"
cd - &> /dev/null
}

@ -10,8 +10,8 @@ export test_archzfs_repo_name="archzfs-testing"
# Additional packages to install in the archiso
export test_archiso_packages="archzfs-linux-lts"
# Additional packages to install in the archiso
export test_chroot_packages="$(<packages) archzfs-linux-git"
# Additional packages to install in the archiso. The 'packages' file is placed in /root on the archiso qemu environment.
export test_chroot_packages="$(< packages) archzfs-linux-git"
export fqdn='test.archzfs.test'
export keymap='us'

@ -8,6 +8,9 @@ test_pacman_config() {
arch_chroot="/usr/bin/arch-chroot ${1}"
fi
msg "Overriding mirrorlist"
run_cmd "cp mirrorlist ${arch_target_dir}/etc/pacman.d/mirrorlist"
msg "Installing archzfs repo into chroot"
printf "\n%s\n%s\n" "[${test_archzfs_repo_name}]" "Server = file:///repo/\$repo/\$arch" >> ${arch_target_dir}/etc/pacman.conf
@ -34,6 +37,7 @@ test_pacman_config() {
test_pacman_pacstrap() {
msg "bootstrapping the base installation"
debug "TEST_CHROOT_PACKAGES: ${test_chroot_packages}"
run_cmd "/usr/bin/pacstrap -c '${test_target_dir}/ROOT' base base-devel ${test_chroot_packages}"
run_cmd_check 1
}

@ -10,7 +10,7 @@ test_build_archiso() {
run_cmd "rm -rf ${test_root_dir}/archiso/out/archlinux*"
fi
run_cmd "./build.sh -v"
msg2 "Coping archiso to packer_work_dir"
msg2 "Copying archiso to packer_work_dir"
run_cmd "cp ${test_root_dir}/../../../archiso/out/archlinux* ${packer_work_dir} && rm -rf ${test_root_dir}/archiso/work"
cd - &> /dev/null
}

@ -10,8 +10,8 @@ export test_archzfs_repo_name="archzfs-testing"
# Additional packages to install in the archiso
export test_archiso_packages="archzfs-linux-lts"
# Additional packages to install in the archiso
export test_chroot_packages="$(<packages) archzfs-linux-lts"
# Additional packages to install in the archiso. The 'packages' file is placed in /root on the archiso qemu environment.
export test_chroot_packages="$(< packages) archzfs-linux-lts"
export fqdn='test.archzfs.test'
export keymap='us'

@ -8,6 +8,9 @@ test_pacman_config() {
arch_chroot="/usr/bin/arch-chroot ${1}"
fi
msg "Overriding mirrorlist"
run_cmd "cp mirrorlist /etc/pacman.d/mirrorlist"
msg "Installing archzfs repo into chroot"
printf "\n%s\n%s\n" "[${test_archzfs_repo_name}]" "Server = file:///repo/\$repo/\$arch" >> ${arch_target_dir}/etc/pacman.conf

@ -6,7 +6,7 @@ test_build_archiso() {
run_cmd "rm -rf ${test_root_dir}/archiso/out/archlinux*"
fi
run_cmd "./build.sh -v"
msg2 "Coping archiso to packer_work_dir"
msg2 "Copying archiso to packer_work_dir"
run_cmd "cp ${test_root_dir}/../../../archiso/out/archlinux* ${packer_work_dir} && rm -rf ${test_root_dir}/archiso/work"
cd - &> /dev/null
}

@ -10,8 +10,8 @@ export test_archzfs_repo_name="archzfs-testing"
# Additional packages to install in the archiso
export test_archiso_packages="archzfs-linux-lts"
# Additional packages to install in the archiso
export test_chroot_packages="$(<packages) archzfs-linux"
# Additional packages to install in the archiso. The 'packages' file is placed in /root on the archiso qemu environment.
export test_chroot_packages="$(< packages) archzfs-linux"
export fqdn='test.archzfs.test'
export keymap='us'

@ -8,6 +8,9 @@ test_pacman_config() {
arch_chroot="/usr/bin/arch-chroot ${1}"
fi
msg "Overriding mirrorlist"
run_cmd "cp mirrorlist /etc/pacman.d/mirrorlist"
msg "Installing archzfs repo into chroot"
printf "\n%s\n%s\n" "[${test_archzfs_repo_name}]" "Server = file:///repo/\$repo/\$arch" >> ${arch_target_dir}/etc/pacman.conf

@ -10,7 +10,7 @@ test_build_archiso() {
run_cmd "rm -rf ${test_root_dir}/archiso/out/archlinux*"
fi
run_cmd "./build.sh -v"
msg2 "Coping archiso to packer_work_dir"
msg2 "Copying archiso to packer_work_dir"
run_cmd "cp ${test_root_dir}/../../../archiso/out/archlinux* ${packer_work_dir} && rm -rf ${test_root_dir}/archiso/work"
cd - &> /dev/null
}

@ -10,8 +10,8 @@ export test_archzfs_repo_name="archzfs-testing"
# Additional packages to install in the archiso
export test_archiso_packages="archzfs-linux-lts"
# Additional packages to install after base and base-devel
export test_chroot_packages="$(<packages) archzfs-linux"
# Additional packages to install in the archiso. The 'packages' file is placed in /root on the archiso qemu environment.
export test_chroot_packages="$(< packages) archzfs-linux"
export fqdn='test.archzfs.test'
export keymap='us'

@ -8,6 +8,9 @@ test_pacman_config() {
arch_chroot="/usr/bin/arch-chroot ${1}"
fi
msg "Overriding mirrorlist"
run_cmd "cp mirrorlist /etc/pacman.d/mirrorlist"
msg "Installing archzfs repo into chroot"
printf "\n%s\n%s\n" "[${test_archzfs_repo_name}]" "Server = file:///repo/\$repo/\$arch" >> ${arch_target_dir}/etc/pacman.conf

Loading…
Cancel
Save