WIP more customizing of the test archiso

It is now possible to connect via ssh for test.
refactor_tests
Jesus Alvarez 8 years ago
parent 361dd9fc2d
commit 647d61c4e1
  1. 10
      archiso/airootfs/root/customize_airootfs.sh
  2. 2
      archiso/build.sh
  3. 5
      conf.sh
  4. 7
      testing/files/25-wired.network
  5. 10
      testing/test.sh

@ -9,8 +9,14 @@ ln -sf /usr/share/zoneinfo/UTC /etc/localtime
usermod -s /usr/bin/zsh root
cp -aT /etc/skel/ /root/
mkdir -p /root/.ssh
cat /root/sshpubkey > /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
chmod 700 /root
echo "root:azfstest" | chpasswd
sed -i 's/#\(PermitRootLogin \).\+/\1yes/' /etc/ssh/sshd_config
sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist
sed -i 's/#\(Storage=\)auto/\1volatile/' /etc/systemd/journald.conf
@ -19,5 +25,7 @@ sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' /etc/systemd/logind.conf
sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' /etc/systemd/logind.conf
sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' /etc/systemd/logind.conf
systemctl enable pacman-init.service choose-mirror.service
cp /root/25-wired.network /etc/systemd/network/25-wired.network
systemctl enable systemd-networkd sshd pacman-init.service choose-mirror.service
systemctl set-default multi-user.target

@ -106,6 +106,8 @@ make_customize_airootfs() {
lynx -dump -nolist 'https://wiki.archlinux.org/index.php/Installation_Guide?action=render' >> ${work_dir}/${arch}/airootfs/root/install.txt
setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r '/root/customize_airootfs.sh' run
rm ${work_dir}/${arch}/airootfs/root/sshpubkey
rm ${work_dir}/${arch}/airootfs/root/25-wired.network
rm ${work_dir}/${arch}/airootfs/root/customize_airootfs.sh
}

@ -29,3 +29,8 @@ package_backup_dir="/data/pacman/repo/archive_archzfs"
# Used to run mkaurball and mksrcinfo with lower privledges
makepkg_nonpriv_user="demizer"
# For embedding in the archiso for testing
ssh_public_key_file="/home/demizer/.ssh/id_rsa_demizer_alvaone_2015-04-12.pub"
azfstest_static_ip="192.168.1.100\/24"
azfstest_gateway="192.168.1.1"

@ -0,0 +1,7 @@
[Match]
Name=ens3
[Network]
Address=
Gateway=

@ -194,12 +194,17 @@ if [[ "${test_mode}" != "" ]]; then
# msg2 "Using packer to build the base image ..."
# # Base files
run_cmd_no_dry_run "cp -vf '${ssh_public_key_file}' '${script_dir}/../archiso/airootfs/root/sshpubkey'"
run_cmd_no_dry_run "cp -vf '${script_dir}/files/25-wired.network' '${script_dir}/../archiso/airootfs/root/25-wired.network'"
run_cmd_no_dry_run "sed -i 's/\\(Address=\\)$/\\1${azfstest_static_ip}/' '${script_dir}/../archiso/airootfs/root/25-wired.network'"
run_cmd_no_dry_run "sed -i 's/\\(Gateway=\\)$/\\1${azfstest_gateway}/' '${script_dir}/../archiso/airootfs/root/25-wired.network'"
run_cmd_no_output_no_dry_run "check_symlink '${script_dir}/tests/archzfs-qemu-base/packages' '${vm_work_dir}/packages'"
# run_cmd_no_output_no_dry_run "check_symlink '${script_dir}/tests/archzfs-qemu-base/packer.json' '${vm_work_dir}/packer.json'"
# run_cmd_no_output_no_dry_run "check_symlink '${script_dir}/tests/archzfs-qemu-base/setup.sh' '${vm_work_dir}/setup.sh'"
# run_cmd_no_output_no_dry_run "check_symlink '${script_dir}/../lib.sh' '${vm_work_dir}/lib.sh'"
# run_cmd_no_output_no_dry_run "check_symlink '${script_dir}/../conf.sh' '${vm_work_dir}/archzfs-conf.sh'"
# run_cmd_no_output_no_dry_run "check_symlink '${script_dir}/files/poweroff.timer' '${vm_work_dir}/poweroff.timer'"
run_cmd_no_output_no_dry_run "check_symlink '${script_dir}/files/poweroff.timer' '${vm_work_dir}/poweroff.timer'"
# # Test files
# run_cmd_no_output_no_dry_run "check_symlink '${test_mode}/archiso.sh' '${vm_work_dir}/test-archiso.sh'"
@ -229,6 +234,9 @@ if [[ "${test_mode}" != "" ]]; then
# msg "Moving the compiled base image"
# run_cmd "mv -f ${base_image_output_dir}/output-qemu/packer-qemu ${base_image_path}"
run_cmd_no_dry_run "rm -rf '${script_dir}/../archiso/airootfs/root/sshpubkey'"
run_cmd_no_dry_run "rm -rf '${script_dir}/../archiso/airootfs/root/25-wired.network'"
msg "Resetting ownership"
run_cmd "chown -R ${makepkg_nonpriv_user}: '${vm_work_dir}'"

Loading…
Cancel
Save