70 lines
1.5 KiB
Bash
Executable File
70 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
#set -ax
|
|
|
|
latest_dev_series="noble"
|
|
latest_sup_series="mantic"
|
|
all_series="bionic focal jammy ${latest_sup_series} ${latest_dev_series}"
|
|
|
|
project_name="sos-testing"
|
|
project="--project ${project_name}"
|
|
lxc="lxc ${project}"
|
|
lxc_exec="${lxc} exec"
|
|
|
|
sos_location="$HOME/gitRepos/sos"
|
|
|
|
lxc project create ${project_name}
|
|
|
|
${lxc} profile edit default < lxd_profile.yaml
|
|
|
|
for distro in ${all_series}
|
|
do
|
|
|
|
inst_name=sos-avocado01-${distro}
|
|
|
|
${lxc} delete ${inst_name} --force
|
|
|
|
if [[ "${distro}" == "${latest_dev_series}" ]] ; then
|
|
image="ubuntu-daily:devel"
|
|
else
|
|
image="ubuntu:${distro}"
|
|
fi
|
|
|
|
${lxc} launch ${image} ${inst_name} --vm -c limits.cpu=4 -c limits.memory=4GiB
|
|
|
|
cd ${sos_location}
|
|
find . -type f -name "*.pyc" -exec sudo rm -f {} \;
|
|
rm -rf .tox *.snap *.deb
|
|
tar cfz /tmp/sos.tgz .
|
|
cd -
|
|
|
|
echo -n "Checking VM status of ${inst_name} "
|
|
|
|
while true ; do
|
|
num_of_procs=$(${lxc} info ${inst_name} | yq .Resources.Processes)
|
|
[[ ${num_of_procs} -gt 0 ]] && break
|
|
sleep 3
|
|
echo -n "."
|
|
done
|
|
|
|
echo done
|
|
|
|
${lxc} file push /tmp/sos.tgz ${inst_name}/root/sos.tgz
|
|
|
|
echo -n "Checking cloud-init status of ${inst_name} "
|
|
|
|
while true ; do
|
|
status=$(${lxc_exec} ${inst_name} -- cloud-init status | grep status | awk '{print $2}')
|
|
[[ "${status}" == "done" ]] && break
|
|
[[ "${status}" == "error" ]] && break
|
|
sleep 3
|
|
echo -n "."
|
|
done
|
|
|
|
echo done
|
|
|
|
${lxc_exec} ${inst_name} -- bash /root/run_avocado.sh
|
|
${lxc} stop ${inst_name}
|
|
|
|
done
|