From f6b1ed8457be31f5c2f79d9cb8037dde635a1e37 Mon Sep 17 00:00:00 2001 From: Michael Vasseur Date: Sun, 27 Oct 2024 22:16:23 +0100 Subject: [PATCH] Add extra test to detect the error Add the case where the user did not run the `make domserver` In that case root will create the files and not chown them to the right user. --- .github/jobs/configure-checks/all.bats | 36 +++++++++++++++++++ .../configure-checks/setup_configure_image.sh | 8 +++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/jobs/configure-checks/all.bats b/.github/jobs/configure-checks/all.bats index 207650895f..ee5a68c3f6 100755 --- a/.github/jobs/configure-checks/all.bats +++ b/.github/jobs/configure-checks/all.bats @@ -40,6 +40,14 @@ setup() { repo-install gcc g++ libcgroup-dev composer } +run_user_stderr () { + su $u -c "$*" 2>&1 +} + +run_stderr () { + "$*" 2>&1 +} + run_configure () { su $u -c "./configure $*" } @@ -454,3 +462,31 @@ compile_assertions_finished () { run make judgehost assert_failure } + +@test "'Make distclean' has all permissions" { + if [ "$distro_id" = "ID=fedora" ]; then + # Fails as libraries are not found + skip + fi + setup + run run_configure + run_user_stderr make domserver + make install-domserver + run_user_stderr make distclean + refute_partial "cannot remove" + refute_partial "Permission denied" + assert_success +} + +@test "'Make distclean' has permission errors" { + if [ "$distro_id" = "ID=fedora" ]; then + # Fails as libraries are not found + skip + fi + setup + run run_configure + run_stderr make install-domserver + run_user_stderr make distclean + assert_partial "cannot remove" + assert_partial "Permission denied" +} diff --git a/.github/jobs/configure-checks/setup_configure_image.sh b/.github/jobs/configure-checks/setup_configure_image.sh index 9c721d2435..af0058809b 100755 --- a/.github/jobs/configure-checks/setup_configure_image.sh +++ b/.github/jobs/configure-checks/setup_configure_image.sh @@ -12,7 +12,11 @@ case $distro_id in apt-get update; apt-get full-upgrade -y apt-get install pkg-config make bats autoconf -y apt-get install composer php php-cli php-curl php-fpm php-gd \ - php-intl php-json php-mbstring php-mysql php-xml php-zip -y ;; + php-intl php-json php-mbstring php-mysql php-xml php-zip \ + acl zip unzip mariadb-server python3-sphinx \ + python3-sphinx-rtd-theme rst2pdf fontconfig python3-yaml \ + latexmk texlive-latex-recommended texlive-latex-extra \ + tex-gyre -y ;; esac # Build the configure file @@ -22,7 +26,7 @@ case $distro_id in "ID=fedora") true ;; *) - composer install --no-scripts ;; + (cd webapp; composer install --no-scripts ) ;; esac # Install extra assert statements for bots