From c082a5438abd8285b02b4b1401f96daa75fa0f5c Mon Sep 17 00:00:00 2001 From: jamesread Date: Fri, 9 Feb 2024 23:47:27 +0000 Subject: [PATCH] cicd: wip --- integration-tests/README.md | 6 ++-- integration-tests/Vagrantfile | 39 +++++++++++------------- integration-tests/get-latest-snapshot.sh | 2 -- integration-tests/runner.mjs | 2 +- 4 files changed, 21 insertions(+), 28 deletions(-) delete mode 100755 integration-tests/get-latest-snapshot.sh diff --git a/integration-tests/README.md b/integration-tests/README.md index d16e40f..3ee8c28 100644 --- a/integration-tests/README.md +++ b/integration-tests/README.md @@ -8,7 +8,7 @@ - Get the snapshot you want to test `make getsnapshot` - To test against VMs: --- `export OLIVETIN_TEST_RUNNER=container` --- `vagrant up f38` (or whatever distro you like defined in `Vagrantfile`) --- `. envVagrant.sh f38` to set the $IP and $PORT +-- `export OLIVETIN_TEST_RUNNER=vm` +-- `vagrant up fedora38` (or whatever distro you like defined in `Vagrantfile`) +-- `. envVagrant.sh fedora38` to set the $IP and $PORT - `mocha` diff --git a/integration-tests/Vagrantfile b/integration-tests/Vagrantfile index d36b4f0..7a29cbd 100644 --- a/integration-tests/Vagrantfile +++ b/integration-tests/Vagrantfile @@ -3,39 +3,34 @@ Vagrant.configure("2") do |config| - config.vm.box = "generic/centos8" config.vm.provision "shell", inline: "mkdir /etc/OliveTin && chmod o+w /etc/OliveTin/", privileged: true - config.vm.provision "file", source: "configs/general/config.yaml/.", destination: "/etc/OliveTin/config.yaml" + config.vm.provision "file", source: "configs/.", destination: "/opt/OliveTin-configs/" config.vm.provider :libvirt do |libvirt| libvirt.management_network_device = 'virbr0' end - config.vm.define :f38 do |f36| - f36.vm.box = "generic/fedora38" - f36.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.rpm", destination: "$HOME/" - f36.vm.provision "shell", inline: "rpm -U OliveTin* && systemctl enable --now OliveTin && systemctl disable --now firewalld" + config.vm.define :stream9 do |i| + i.vm.box = "centos/stream9" + i.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.rpm", destination: "$HOME/" + i.vm.provision "shell", inline: "rpm -U OliveTin* && systemctl enable --now OliveTin && systemctl disable --now firewalld" end - config.vm.define :f36 do |f36| - f36.vm.box = "generic/fedora36" - f36.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.rpm", destination: "$HOME/" - f36.vm.provision "shell", inline: "rpm -U OliveTin* && systemctl enable --now OliveTin && systemctl disable --now firewalld" + config.vm.define :fedora38 do |i| + i.vm.box = "generic/fedora38" + i.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.rpm", destination: "$HOME/" + i.vm.provision "shell", inline: "rpm -U OliveTin* && systemctl enable --now OliveTin && systemctl disable --now firewalld" end - config.vm.define :debian do |debian| - debian.vm.box = "generic/debian10" - debian.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.deb", destination: "$HOME/" - debian.vm.provision "shell", inline: "dpkg --force-confold -i OliveTin* && systemctl enable --now OliveTin" + config.vm.define :debian12 do |i| + i.vm.box = "debian/bookworm64" + i.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.deb", destination: "$HOME/" + i.vm.provision "shell", inline: "dpkg --force-confold -i OliveTin* && systemctl enable --now OliveTin" end - config.vm.define :ubuntu do |ubuntu| - ubuntu.vm.box = "generic/ubuntu2110" - ubuntu.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.deb", destination: "$HOME/" - ubuntu.vm.provision "shell", inline: "dpkg --force-confold -i OliveTin* && systemctl enable --now OliveTin && systemctl disable --now firewalld" + config.vm.define :ubuntu2310 do |i| + i.vm.box = "ubuntu/mantic64" + i.vm.provision "file", source: "/opt/OliveTin-snapshot/OliveTin_linux_amd64.deb", destination: "$HOME/" + i.vm.provision "shell", inline: "dpkg --force-confold -i OliveTin* && systemctl enable --now OliveTin && systemctl disable --now firewalld" end - - # TODO - # - end diff --git a/integration-tests/get-latest-snapshot.sh b/integration-tests/get-latest-snapshot.sh deleted file mode 100755 index eb48cf8..0000000 --- a/integration-tests/get-latest-snapshot.sh +++ /dev/null @@ -1,2 +0,0 @@ -rm -rf /opt/OliveTin-snapshot/* -gh run download -D /opt/OliveTin-snapshot/ diff --git a/integration-tests/runner.mjs b/integration-tests/runner.mjs index b31be42..6902ff1 100644 --- a/integration-tests/runner.mjs +++ b/integration-tests/runner.mjs @@ -96,7 +96,7 @@ class OliveTinTestRunnerVm extends OliveTinTestRunnerEnv { async start (cfg) { console.log("vagrant changing config") - spawn('vagrant', ['ssh', '-c', '"ln -sf /etc/OliveTin/ /opt/otConfigs/' + cfg + '/"']) + spawn('vagrant', ['ssh', '-c', '"ln -sf /etc/OliveTin/ /opt/OliveTin-configs/' + cfg + '/config.yaml"']) spawn('vagrant', ['ssh', '-c', '"systemctl restart OliveTin"']) return null