-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[debian] Packaging and testing for debian pkgs
Initial start of building and testing the deb package This will improve the overall testing of sos over the Ubuntu releases, and also helps with the basis of thenadding further stagetwo testing in the future. This will help to pick up issues automatically rather than the manual testing. Add ubuntu-latest for deb CI build and testing. Update the GCE images for all ubuntu images for CI testing Co-authored-by: Nikhil Kshirsagar <[email protected]> Signed-off-by: Nikhil Kshirsagar <[email protected]> Signed-off-by: Arif Ali <[email protected]>
- Loading branch information
1 parent
52c9237
commit 314cc50
Showing
15 changed files
with
426 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ env: | |
|
||
DEBIAN_NAME: "debian-11" | ||
|
||
UBUNTU_LATEST_NAME: "ubuntu-23.10" | ||
UBUNTU_NAME: "ubuntu-22.04" | ||
UBUNTU_PRIOR_NAME: "ubuntu-20.04" | ||
UBUNTU_PRIOR2_NAME: "ubuntu-18.04" | ||
|
@@ -27,10 +28,11 @@ env: | |
DEBIAN_IMAGE_NAME: "debian-11-bullseye-v20230809" | ||
FEDORA_IMAGE_NAME: "fedora-cloud-base-gcp-38-1-6-x86-64" | ||
FEDORA_PRIOR_IMAGE_NAME: "fedora-cloud-base-gcp-37-1-7-x86-64" | ||
UBUNTU_IMAGE_NAME: "ubuntu-2204-jammy-v20230727" | ||
UBUNTU_PRIOR_IMAGE_NAME: "ubuntu-2004-focal-v20230724" | ||
UBUNTU_LATEST_IMAGE_NAME: "ubuntu-2310-mantic-amd64-v20231031" | ||
UBUNTU_IMAGE_NAME: "ubuntu-2204-jammy-v20231030" | ||
UBUNTU_PRIOR_IMAGE_NAME: "ubuntu-2004-focal-v20231101" | ||
UBUNTU_PRIOR2_IMAGE_NAME: "ubuntu-1804-bionic-v20230605" | ||
UBUNTU_SNAP_IMAGE_NAME: "ubuntu-2204-jammy-v20230727" | ||
UBUNTU_SNAP_IMAGE_NAME: "ubuntu-2204-jammy-v20231030" | ||
|
||
# Curl-command prefix for downloading task artifacts, simply add the | ||
# the url-encoded task name, artifact name, and path as a suffix. | ||
|
@@ -115,6 +117,27 @@ rpm_build_task: | |
path: ./sos_${BUILD_NAME}.rpm | ||
type: application/octet-stream | ||
|
||
# Make sure a user can manually build a deb from the checkout | ||
deb_build_task: | ||
alias: "deb_build" | ||
name: "deb Build From Checkout" | ||
gce_instance: | ||
image_project: "${UBUNTU_PROJECT}" | ||
image_name: "${UBUNTU_LATEST_IMAGE_NAME}" | ||
type: e2-medium | ||
setup_script: | | ||
apt update --allow-releaseinfo-change | ||
apt -y install devscripts equivs python3-pip | ||
mk-build-deps | ||
apt -y install ./sosreport-build-deps*.deb | ||
pip3 install avocado-framework==94.0 --break-system-packages | ||
main_script: | | ||
dpkg-buildpackage -b -us -uc -rfakeroot -m --build-by="[email protected]" | ||
prep_artifacts_script: mv ../*.deb ./sos_cirrus.deb | ||
packages_artifacts: | ||
path: ./sos_cirrus.deb | ||
type: application/octet-stream | ||
|
||
# Make sure a user can manually build a snap from the checkout | ||
snap_build_task: | ||
alias: "snap_build" | ||
|
@@ -146,6 +169,7 @@ report_stageone_task: | |
depends_on: | ||
- rpm_build | ||
- snap_build | ||
- deb_build | ||
gce_instance: *standardvm | ||
matrix: | ||
- env: *centos9 | ||
|
@@ -156,24 +180,38 @@ report_stageone_task: | |
PROJECT: ${UBUNTU_PROJECT} | ||
BUILD_NAME: ${UBUNTU_NAME} | ||
VM_IMAGE_NAME: ${UBUNTU_IMAGE_NAME} | ||
PKG: "snap" | ||
- env: &ubuntuprior | ||
PROJECT: ${UBUNTU_PROJECT} | ||
BUILD_NAME: ${UBUNTU_PRIOR_NAME} | ||
VM_IMAGE_NAME: ${UBUNTU_PRIOR_IMAGE_NAME} | ||
PKG: "snap" | ||
- env: &ubuntuprior2 | ||
PROJECT: ${UBUNTU_PROJECT} | ||
BUILD_NAME: ${UBUNTU_PRIOR2_NAME} | ||
VM_IMAGE_NAME: ${UBUNTU_PRIOR2_IMAGE_NAME} | ||
PKG: "snap" | ||
- env: &ubuntu-latest | ||
PROJECT: ${UBUNTU_PROJECT} | ||
BUILD_NAME: ${UBUNTU_LATEST_NAME} | ||
VM_IMAGE_NAME: ${UBUNTU_LATEST_IMAGE_NAME} | ||
PKG: "deb" | ||
setup_script: &setup | | ||
if [ $(command -v apt) ]; then | ||
echo "$ARTCURL/snap%20Build%20From%20Checkout/packages/sosreport_test_amd64.snap" | ||
$ARTCURL/snap%20Build%20From%20Checkout/packages/sosreport_test_amd64.snap | ||
apt -y purge sosreport | ||
apt update --allow-releaseinfo-change | ||
apt -y install python3-pip snapd | ||
systemctl start snapd | ||
snap install ./sosreport_test_amd64.snap --classic --dangerous | ||
snap alias sosreport.sos sos | ||
if [ ${PKG} == "snap" ] ; then | ||
echo "$ARTCURL/snap%20Build%20From%20Checkout/packages/sosreport_test_amd64.snap" | ||
$ARTCURL/snap%20Build%20From%20Checkout/packages/sosreport_test_amd64.snap | ||
systemctl start snapd | ||
snap install ./sosreport_test_amd64.snap --classic --dangerous | ||
snap alias sosreport.sos sos | ||
elif [ ${PKG} == "deb" ]; then | ||
echo "$ARTCURL/deb%20Build%20From%20Checkout/packages/sos_cirrus.deb" | ||
$ARTCURL/deb%20Build%20From%20Checkout/packages/sos_cirrus.deb | ||
apt -y install ./sos_cirrus.deb | ||
fi | ||
fi | ||
if [ $(command -v dnf) ]; then | ||
echo "$ARTCURL/rpm%20Build%20From%20Checkout%20-%20${BUILD_NAME}/packages/sos_${BUILD_NAME}.rpm" | ||
|
@@ -182,7 +220,9 @@ report_stageone_task: | |
dnf -y install python3-pip ethtool | ||
dnf -y install ./sos_${BUILD_NAME}.rpm | ||
fi | ||
pip3 install avocado-framework==94.0 | ||
PIP_EXTRA="" | ||
[[ $(pip3 install --help | grep break-system) ]] && PIP_EXTRA="--break-system-packages" | ||
pip3 install avocado-framework==94.0 ${PIP_EXTRA} | ||
# run the unittests separately as they require a different PYTHONPATH in | ||
# order for the imports to work properly under avocado | ||
unittest_script: PYTHONPATH=. avocado run tests/unittests/ | ||
|
@@ -205,6 +245,7 @@ report_stagetwo_task: | |
- env: *centos8 | ||
- env: *fedora | ||
- env: *ubuntu | ||
- env: *ubuntu-latest | ||
setup_script: *setup | ||
install_pexpect_script: | | ||
if [ $(command -v apt) ]; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sosreport (4.6.0-0ubuntu1) mantic; urgency=medium | ||
|
||
* New 4.6.0 upstream. | ||
|
||
-- Nikhil Kshirsagar <[email protected]> Thu, 17 Aug 2023 08:17:20 +0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Source: sosreport | ||
Maintainer: Nikhil Kshirsagar <[email protected]> | ||
Section: admin | ||
Priority: optional | ||
Standards-Version: 4.5.1 | ||
Build-Depends: | ||
debhelper-compat (= 13), | ||
dh-python, | ||
gettext, | ||
python3-all, | ||
python3-coverage, | ||
python3-nose, | ||
python3-setuptools, | ||
python3-sphinx, | ||
python3-magic, | ||
python3-pexpect, | ||
Homepage: https://github.com/sosreport/sos | ||
Vcs-Browser: https://salsa.debian.org/sosreport-team/sosreport | ||
Vcs-Git: https://salsa.debian.org/sosreport-team/sosreport.git | ||
|
||
Package: sosreport | ||
Architecture: any | ||
Depends: ${python3:Depends}, ${misc:Depends}, python3-pexpect, python3-magic | ||
Description: Set of tools to gather troubleshooting data from a system | ||
Sos is a set of tools that gathers information about system | ||
hardware and configuration. The information can then be used for | ||
diagnostic purposes and debugging. Sos is commonly used to help | ||
support technicians and developers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: sosreport | ||
Upstream-Contact: Jake Hunsaker <[email protected]> | ||
Source: https://github.com/sosreport/sos | ||
|
||
License: GPL-2+ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or (at | ||
your option) any later version. | ||
. | ||
This program is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, | ||
USA. | ||
. | ||
On Debian systems, the complete text of the GNU General Public | ||
License, version 2, can be found in /usr/share/common-licenses/GPL-2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/etc/sos | ||
/etc/sos/cleaner | ||
/etc/sos/extras.d | ||
/etc/sos/groups.d | ||
/etc/sos/presets.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
README.md AUTHORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sos.conf etc/sos/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Description: Change default location to /tmp | ||
--- a/sos.conf | ||
+++ b/sos.conf | ||
@@ -7,6 +7,7 @@ | ||
#verify = yes | ||
#batch = yes | ||
#log-size = 15 | ||
+tmp-dir = /tmp | ||
|
||
[report] | ||
# Options that will apply to any `sos report` run should be listed here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0001-debian-change-tmp-dir-location.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/make -f | ||
|
||
export PYBUILD_NAME=sosreport | ||
|
||
%: | ||
dh $@ --with python3 --buildsystem=pybuild | ||
|
||
override_dh_install: | ||
# Move config file to the right location. | ||
mv debian/sosreport/usr/config/sos.conf debian/sosreport/etc/sos/sos.conf | ||
# Remove unnecessary unused dir. | ||
rm -rf debian/sosreport/usr/config | ||
|
||
override_dh_auto_test: | ||
nosetests3 -v --with-cover --cover-package=sos tests/unittests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (quilt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Tests: simple.sh | ||
Depends: sosreport | ||
Restrictions: needs-root, allow-stderr, isolation-machine |
Oops, something went wrong.