Skip to content

Commit

Permalink
Add initial github tests
Browse files Browse the repository at this point in the history
Add running and packaging tests.
Fix problems found when adding tests

Signed-off-by: Corentin Labbe <[email protected]>
  • Loading branch information
montjoie committed Oct 11, 2024
1 parent 0eead3d commit f534739
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# yamllint disable rule:line-length
name: tests yasat

on: # yamllint disable-line rule:truthy
push:
pull_request:

jobs:
test-ubuntu:
runs-on: ubuntu-latest
name: test on ubuntu
steps:
- uses: actions/checkout@v4
- name: update pkglist
run: sudo apt-get update
- name: Run yasat
run: |
./yasat
./yasat -1 ntp
test-bashishms:
runs-on: ubuntu-latest
name: Check bashisms
steps:
- uses: actions/checkout@v4
- name: update pkglist
run: sudo apt-get update
- name: install checkbashisms
run: sudo apt-get -y install checkbashisms
- name: Run checkbashisms
run: checkbashisms yasat common scripts/*test
ubuntu-pkg:
runs-on: ubuntu-latest
name: build ubuntu package
steps:
- uses: actions/checkout@v4
- name: update pkglist
run: sudo apt-get update
- name: Install packages
run: sudo apt-get -y install devscripts gnupg debhelper-compat
- name: create orig targz
run: cd .. && tar czf yasqt_0-1.orig.tar.gz yasat
- name: Run ls
run: ls -l
- name: Run debuild
run: debuild -i -us -uc -b
- name: Run debuild help
run: debuild --help

14 changes: 14 additions & 0 deletions common
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,20 @@ Is_installed_via_package_manager()
return 0;
fi
if [ "$LIST_PKG" = "emerge" ] ;then
if [ -z "$CACHE_EMERGE_OK" ];then
# check if we have can use portage
emerge --info 2>/dev/null >/dev/null
if [ $? -ne 0 ];then
Display --indent 2 --text "Could not work with emerge (cached)" --result EPERM --color RED
CACHE_EMERGE_OK="ko"
return 0
fi
fi
if [ "$CACHE_EMERGE_OK" = 'ko' ];then
Display --indent 2 --text "Could not work with emerge (cached)" --result EPERM --color RED
return 0
fi
CACHE_EMERGE_OK="ok"
#TODO could be better
PKGLIST="`equery -C -q l $1`"
if [ -z "$PKGLIST" ] ;then
Expand Down
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
7
10 changes: 9 additions & 1 deletion plugins/apache_modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ fi
check_file "$APACHE_BIN" 2 BINARY

if [ "$LINUX_VERSION" = "Gentoo" ] ;then
. /etc/conf.d/apache2
if [ ! -r /etc/conf.d/apache2 ];then
TESTNAME='YASAT_TEST_APACHE_MODULES_READ_CONFD_APACHE Check if we can use /etc/conf.d/apache2'
Display --indent 2 --text "Cannot read /etc/conf.d/apache2" --result ERROR --color RED
else
. /etc/conf.d/apache2
if [ $? -ne 0 ];then
echo "ERROR: could not read /etc/conf.d/apache2"
fi
fi
APACHE_BIN="$APACHE_BIN $APACHE2_OPTS"
fi

Expand Down
5 changes: 5 additions & 0 deletions plugins/process.data
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ aisexec=CANBEROOT
/usr/sbin/atd=CANBEROOT
/usr/sbin/monit=CANBEROOT
/sbin/rsyslogd=CANBEROOT
/usr/bin/containerd=CANBEROOT
/usr/libexec/packagekitd=CANBEROOT
/usr/libexec/polkitd=CANBEROOT
/sbin/agetty=CANBEROOT
/usr/bin/podman=CANBEROOT

#ONLYROOT
/sbin/udevd=ONLYROOT
Expand Down

0 comments on commit f534739

Please sign in to comment.