diff --git a/do_sos_avocado.sh b/do_sos_avocado.sh index 553db06..e3ae9c3 100755 --- a/do_sos_avocado.sh +++ b/do_sos_avocado.sh @@ -7,11 +7,10 @@ script_cmd=${0##*/} declare -A all_series all_series=( - ['bionic']="ubuntu:bionic" +# ['bionic']="ubuntu:bionic" ['focal']="ubuntu:focal" ['jammy']="ubuntu:jammy" ['noble']="ubuntu:noble" - ['mantic']="ubuntu:mantic" ['oracular']="ubuntu-daily:devel" ) @@ -111,10 +110,10 @@ EOF fi if [[ "${script_cmd}" == "do_sos_avocado.sh" ]] ; then - ${lxc_exec} ${inst_name} -- bash /root/run_avocado.sh + ${lxc_exec} ${inst_name} -- bash /root/run_avocado.sh | tee sos_run_avocado_${distro}.log elif [[ "${script_cmd}" == "do_sos_testing.sh" ]] ; then ${lxc_exec} ${inst_name} -- bash /root/setup_sos.sh - ${lxc_exec} ${inst_name} -- bash /root/run_sos.sh + ${lxc_exec} ${inst_name} -- bash /root/run_sos.sh | tee sos_run_base_${distro}.log fi ${lxc} stop ${inst_name} diff --git a/do_sos_avocado_rh.sh b/do_sos_avocado_rh.sh index db1d730..ec04539 100755 --- a/do_sos_avocado_rh.sh +++ b/do_sos_avocado_rh.sh @@ -40,7 +40,6 @@ do ${lxc} launch ${image} ${inst_name} --vm -c limits.cpu=4 -c limits.memory=4GiB - if [[ "${script_cmd}" == "do_sos_avocado_rh.sh" ]] ; then cd ${sos_location} find . -type f -name "*.pyc" -exec sudo rm -f {} \; @@ -76,29 +75,9 @@ do echo done - if [[ "${script_cmd}" == "do_sos_testing.sh" ]] ; then - ${lxc_exec} ${inst_name} -- sudo add-apt-repository -y ppa:${ppa_user}/${ppa_name} - if [[ "${distro}" == "${latest_dev_series}" ]] ; then - filename="$(echo ${ppa_name} | sed 's/\./_/g')" - ${lxc_exec} ${inst_name} -- sed -i s/i${latest_sup_series}/${latest_dev_series}/g /etc/apt/sources.list.d/${ppa_user}-ubuntu-${filename}-${latest_sup_series}.list - fi - cat > setup_sos.sh << EOF -#!/bin/bash - -sos_type="${sos_type}" - -if [[ "\${sos_type}" == "deb" ]] ; then - apt -y install sosreport -elif [[ "\${sos_type}" == "snap" ]] ; then - snap install sosreport --channel ${sos_channel} --classic -fi -EOF - ${lxc} file push setup_sos.sh ${inst_name}/root/setup_sos.sh - fi - if [[ "${script_cmd}" == "do_sos_avocado_rh.sh" ]] ; then ${lxc_exec} ${inst_name} -- bash /root/run_avocado.sh - elif [[ "${script_cmd}" == "do_sos_testing.sh" ]] ; then + elif [[ "${script_cmd}" == "do_sos_testing_rh.sh" ]] ; then ${lxc_exec} ${inst_name} -- bash /root/setup_sos.sh ${lxc_exec} ${inst_name} -- bash /root/run_sos.sh fi diff --git a/do_sos_deb.sh b/do_sos_deb.sh index 966add0..56301a3 100755 --- a/do_sos_deb.sh +++ b/do_sos_deb.sh @@ -7,6 +7,8 @@ script_cmd=${0##*/} declare -A all_series all_series=( +# ['bookworm']="debian/12/cloud" +# ['trixie']="debian/13/cloud" ['sid']="debian/sid/cloud" ) @@ -64,7 +66,7 @@ do echo done ${lxc_exec} ${inst_name} -- bash /root/deb_build_check.sh - ${lxc} file pull ${inst_name}/root/build-logs.tgz . + ${lxc} file pull ${inst_name}/root/build-logs.tgz build-logs-${distro}.tgz. ${lxc} stop ${inst_name} done diff --git a/lxd_profile.yaml b/lxd_profile.yaml index f4f0f44..abb148a 100644 --- a/lxd_profile.yaml +++ b/lxd_profile.yaml @@ -74,5 +74,21 @@ config: sos report -a --all-logs --batch + echo "Check list of files ..." + ls -l /tmp/sos* + + echo "Check sha256sum ..." + sha256sum /tmp/sos*.tar.xz + cat /tmp/sos*.sha256 + + echo "Extracting the sos eport ..." + tar xf /tmp/sos*.tar.xz + + echo "Check any file size that is 0 ..." + find sosreport*/ -type f -size 0 + + echo "Check any non INFO messages in sos.log ..." + grep -v "INFO:" sosreport*/sos_logs/sos.log + runcmd: - [ /root/setup.sh ] diff --git a/sos_collect_testing.sh b/sos_collect_testing.sh index 9a22ee6..69b847f 100755 --- a/sos_collect_testing.sh +++ b/sos_collect_testing.sh @@ -1,35 +1,51 @@ #!/bin/bash -series="jammy" -model="${series}-sos" +deb_type="proposed" +sleep=5 +num_of_nodes=4 -cat > juju-model-sos.yaml << EOF -cloudinit-userdata: | - package_update: true - package_upgrade: true - apt: - sources: - proposed: - source: deb \$MIRROR \$RELEASE-proposed restricted main multiverse universe - ppa: - source: ppa:arif-ali/sosreport-dev - packages: - - sosreport - #postruncmd: - # - [ 'apt', 'install', '-y', 'sosreport/*-proposed' ] -EOF +declare -A all_series +all_series=( + ['focal']="ubuntu:focal" + ['jammy']="ubuntu:jammy" + ['noble']="ubuntu:noble" +) -juju add-model ${model} -juju model-config ./juju-model-sos.yaml +for series in "${!all_series[@]}" +do -juju deploy ubuntu --series ${series} -n 5 --force + model="${series}-sos" -juju-wait -v -e ${model} + juju add-model ${model} + juju model-config cloudinit-userdata="$(cat sos_collect_user-data.yaml)" + juju add-ssh-key "$(cat ~/.ssh/aarsa4096canonical.pub)" -# wait for package to finish install -sleep 5 + if [[ ${series} == "noble" ]] ; then + juju add-machine --series ${series} -n ${num_of_nodes} + else + juju deploy ubuntu --series ${series} -n ${num_of_nodes} --force + fi -juju run --all -- dpkg -l sosreport + juju-wait -m ${model} -sos collect --cluster-type juju --no-local -c "juju.apps=ubuntu" --batch --case-id 3524678 --all-logs -a + # wait for package to finish install + echo Sleeping for ${sleep} seconds for cloud-init to finish + sleep ${sleep} + + if [[ "${deb_type}" == "proposed" ]] ; then + juju run --all -- 'sudo bash /root/enable_proposed.sh' + elif [[ "${deb_type}" == "ppa" ]] ; then + juju run --all -- 'sudo bash /root/enable_ppa.sh' + fi + juju run --all -- sudo apt -y install sosreport + juju run --all -- dpkg -l sosreport + + if [[ ${series} == "noble" ]] ; then + sos collect --cluster-type juju --no-local -c "juju.machines=$(seq -s, 0 $((num_of_nodes-1)))" --batch --case-id 3524678 --all-logs -a > sos_collect_${series}.log 2>&1 + else + sos collect --cluster-type juju --no-local -c "juju.apps=ubuntu" --batch --case-id 3524678 --all-logs -a > sos_collect_${series}.log 2>&1 + fi + + juju destroy-model -y ${model} +done diff --git a/sos_collect_user-data.yaml b/sos_collect_user-data.yaml new file mode 100644 index 0000000..ca77288 --- /dev/null +++ b/sos_collect_user-data.yaml @@ -0,0 +1,43 @@ +#cloud-config + +package_update: true +package_upgrade: true + +apt: + disable_suites: + - $RELEASE-proposed + sources_list: | + deb $MIRROR $RELEASE main restricted multiverse universe + deb $MIRROR $RELEASE-updates main restricted multiverse universe + deb $MIRROR $RELEASE-backports main restricted multiverse universe + deb $MIRROR $RELEASE-security main restricted multiverse universe + deb $MIRROR $RELEASE-proposed main restricted multiverse universe + +write_files: + - path: /root/enable_proposed.sh + permissions: '0755' + owner: root:root + content: | + #!bin/bash + + echo "Enabling proposed repo ..." + sudo sed -i 's/# suite disabled by cloud-init: //g' /etc/apt/sources.list + sudo apt update + - path: /root/enable_ppa.sh + permissions: '0755' + owner: root:root + content: | + #!/bin/bash + + # add-apt-repository -y ppa:arif-ali/sosreport-dev + add-apt-repository -y ppa:sosreport/sosreport-daily + - path: /root/setup.sh + permissions: '0755' + owner: root:root + content: | + #!bin/bash + sudo apt update --allow-releaseinfo-change + sudo apt -y purge sosreport + +postruncmd: + - [ /root/setup.sh ]