[Rt-commit] rt branch, 4.4/add-postgresql-apache-fcgid-tests2, created. rt-4.4.4-198-ge8a7e1f95f

Jim Brandt jbrandt at bestpractical.com
Thu Dec 24 09:20:30 EST 2020


The branch, 4.4/add-postgresql-apache-fcgid-tests2 has been created
        at  e8a7e1f95f98ab168bafaf1b7e585005c8fc8eeb (commit)

- Log -----------------------------------------------------------------
commit b1c8847a7ff25fa6b86f6853e7d1d6b4288e8a09
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Dec 21 15:18:37 2020 -0500

    Enable gpg tests for RT 4.4 testing

diff --git a/.travis.yml b/.travis.yml
index 9a3695ae32..68426466cb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,7 +14,7 @@ before_install:
   - docker build -t rt-base .
   - docker run -d -v $TRAVIS_BUILD_DIR:/rt --name rt --link mariadb:db rt-base
   - docker ps -a
-  - docker exec -it rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --disable-gpg --disable-smime && mkdir -p /rt/var && make testdeps"
+  - docker exec -it rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
 
 script:
     - docker exec -it rt bash -c "cd /rt && prove -lj9 t/*"
diff --git a/Dockerfile b/Dockerfile
index d77111ec6f..98bafcd6c0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,7 +9,4 @@ ENV RT_DBA_PASSWORD password
 ENV RT_TEST_DB_HOST=172.17.0.2
 ENV RT_TEST_RT_HOST=172.17.0.3
 
-# Skip gpg tests until we update to gpg 2.2
-ENV SKIP_GPG_TESTS=1
-
 CMD tail -f /dev/null

commit cf3a1b6fc2b68a99a746142ea05a166c4fceb302
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 24 05:14:22 2020 +0800

    No need to show "Preferred GnuPG key" if GnuPG is not enabled
    
    Otherwise RT would always try to get possible GnuPG keys, but GnuPG it's
    not fully set up, it would cause a few warnings like:
    
        got warning: gpg: keyblock resource '/opt/rt5/var/data/gpg/pubring.kbx': No such file or directory
        gpg: Fatal: /opt/rt5/var/data/gpg: directory does not exist!
    
    This could also cause tests that touch /Prefs/Other.html to fail, e.g.
    t/web/quickcreate.t, t/web/redirect-after-login.t, etc.
    
    Before 4.4/per-queue-outgoing-encryption-protocol, we didn't have this
    issue because "Protocol => GnuPG" was not explicitly passed, and
    RT::Crypt excluded the automatically-disabled GnuPG protocol.
    
    This commit hid the whole "Cryptography" widget since "Preferred GnuPG
    key" is the only input there.

diff --git a/share/html/Prefs/Other.html b/share/html/Prefs/Other.html
index e2526dbd91..537a102029 100644
--- a/share/html/Prefs/Other.html
+++ b/share/html/Prefs/Other.html
@@ -67,7 +67,7 @@
 </&>
 % }
 
-% if ( RT->Config->Get('Crypt')->{'Enable'} ) {
+% if ( RT->Config->Get('GnuPG')->{'Enable'} ) {
 <&|/Widgets/TitleBox, title => loc( 'Cryptography' ) &>
 <&|/l&>Preferred GnuPG key</&>: <& /Elements/Crypt/SelectKeyForEncryption, Name => 'PreferredKey', EmailAddress => $UserObj->EmailAddress, Default => $UserObj->PreferredKey, Protocol => 'GnuPG' &>
 </&>

commit 48ba36c7476bfcdb7078c4492f4b831f3152220f
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Mon Aug 24 14:56:22 2020 -0400

    Add support for Apache with mod_fcgid

diff --git a/configure.ac b/configure.ac
index e10ccf199a..005f8e09be 100755
--- a/configure.ac
+++ b/configure.ac
@@ -54,9 +54,9 @@ AC_ARG_WITH(web-handler,
         ]),
     WEB_HANDLER=$withval,
     WEB_HANDLER=fastcgi)
-my_web_handler_test=$($PERL -e 'print "ok" unless grep $_ !~ /^(modperl1|modperl2|fastcgi|standalone)$/i, grep defined && length, split /\s*,\s*/, $ARGV@<:@0@:>@' $WEB_HANDLER)
+my_web_handler_test=$($PERL -e 'print "ok" unless grep $_ !~ /^(modperl1|modperl2|fastcgi|fcgid|standalone)$/i, grep defined && length, split /\s*,\s*/, $ARGV@<:@0@:>@' $WEB_HANDLER)
 if test "$my_web_handler_test" != "ok"; then
-	AC_MSG_ERROR([Only modperl1, modperl2, fastcgi and standalone are valid web-handlers])
+	AC_MSG_ERROR([Only modperl1, modperl2, fastcgi, fcgid and standalone are valid web-handlers])
 fi
 AC_SUBST(WEB_HANDLER)
 
@@ -503,6 +503,7 @@ AC_CONFIG_FILES([
                  t/data/configs/apache2.2+mod_perl.conf
                  t/data/configs/apache2.2+fastcgi.conf
                  t/data/configs/apache2.4+mod_perl.conf
-                 t/data/configs/apache2.4+fastcgi.conf],
+                 t/data/configs/apache2.4+fastcgi.conf
+                 t/data/configs/apache2.4+fcgid.conf],
                )
 AC_OUTPUT
diff --git a/lib/RT/Test/Apache.pm b/lib/RT/Test/Apache.pm
index 2cb0df4187..3c0bfe0505 100644
--- a/lib/RT/Test/Apache.pm
+++ b/lib/RT/Test/Apache.pm
@@ -58,6 +58,7 @@ my %MODULES = (
     '2.4' => {
         "mod_perl" => [qw(mpm_worker authz_core authn_core authz_host env alias perl)],
         "fastcgi"  => [qw(mpm_worker authz_core authn_core authz_host env alias mime fastcgi)],
+        "fcgid"  => [qw(mpm_worker authz_core authn_core authz_host env alias mime fcgid)],
     },
 );
 
diff --git a/t/data/configs/apache2.4+fcgid.conf.in b/t/data/configs/apache2.4+fcgid.conf.in
new file mode 100644
index 0000000000..0ef6cf99d4
--- /dev/null
+++ b/t/data/configs/apache2.4+fcgid.conf.in
@@ -0,0 +1,47 @@
+ServerRoot %%SERVER_ROOT%%
+PidFile %%PID_FILE%%
+ServerAdmin root at localhost
+
+%%LOAD_MODULES%%
+
+<IfModule !mpm_netware_module>
+<IfModule !mpm_winnt_module>
+User @WEB_USER@
+Group @WEB_GROUP@
+</IfModule>
+</IfModule>
+
+ServerName localhost
+Listen %%LISTEN%%
+
+ErrorLog "%%LOG_FILE%%"
+LogLevel debug
+
+<Directory />
+    Options FollowSymLinks
+    AllowOverride None
+    Require all denied
+</Directory>
+
+AddDefaultCharset UTF-8
+
+FcgidConnectTimeout 20
+FcgidProcessTableFile %%tmp_dir%%/shm
+FcgidIPCDir %%tmp_dir%%
+FcgidInitialEnv RT_TESTING 1
+FcgidInitialEnv RT_SITE_CONFIG %%RT_SITE_CONFIG%%
+
+ScriptAlias / %%RT_SBIN_PATH%%/rt-server.fcgi/
+
+DocumentRoot "%%DOCUMENT_ROOT%%"
+<Location />
+
+    <RequireAll>
+        Require all granted
+%%BASIC_AUTH%%
+    </RequireAll>
+
+    Options +ExecCGI
+    AddHandler fcgid-script .fcgi
+</Location>
+

commit 1f5bc46c48441f8c7cc53fb83408eb0350c28ebe
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Dec 24 09:17:10 2020 -0500

    Run docker tests with Apache

diff --git a/.travis.yml b/.travis.yml
index 68426466cb..67ccb761d2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ notifications:
     secure: ebb/6lbr1ob7wMh04C5PzM5/NNz6IstEUaUROA7BATuKKgPetl6qwmQNwvlwE5zYvJQBWQwKJ70JaCzJkXK6JVMVRRAWsXINJTzMfSqsoXEcJ59c5isf0bsnspVO7jxHTfXF/NZngR4EuPwH5v5lWp9m++j90t9nBKFFVi34WUE=
 
 env:
-  - RT_TEST_PARALLEL=1 RT_DBA_USER=root RT_DBA_PASSWORD=password DB_VERSION_TAG=10.3
+  - RT_TEST_PARALLEL=1 RT_DBA_USER=root RT_DBA_PASSWORD=password DB_VERSION_TAG=10.3 RT_TEST_WEB_HANDLER=apache+fcgid HTTPD_ROOT=/etc/apache2 RT_TEST_APACHE=/usr/sbin/apache2 RT_TEST_APACHE_MODULES=/usr/lib/apache2/modules
 
 # $TRAVIS_BUILD_DIR will have a clone of the current branch
 before_install:
@@ -14,7 +14,8 @@ before_install:
   - docker build -t rt-base .
   - docker run -d -v $TRAVIS_BUILD_DIR:/rt --name rt --link mariadb:db rt-base
   - docker ps -a
-  - docker exec -it rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps"
+  - docker exec -it rt bash -c "chown -R rt-test /rt; touch /etc/apache2/mime.types"
+  - docker exec -u rt-test -it rt bash -c "cd /rt && ./configure.ac --with-db-type=mysql --with-my-user-group --enable-layout=inplace --with-web-handler=fcgid --enable-developer --enable-externalauth --enable-gpg --enable-smime && mkdir -p /rt/var && make testdeps && chmod a+rX /rt/sbin/*"
 
 script:
-    - docker exec -it rt bash -c "cd /rt && prove -lj9 t/*"
+    - docker exec -u rt-test -it rt bash -c "cd /rt && prove -lj9 t/*"
diff --git a/Dockerfile b/Dockerfile
index 98bafcd6c0..6245e7f619 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,4 +9,14 @@ ENV RT_DBA_PASSWORD password
 ENV RT_TEST_DB_HOST=172.17.0.2
 ENV RT_TEST_RT_HOST=172.17.0.3
 
+# These APACHE ENVs are set as needed .travis.yml for CI
+# They are here for convenience when testing manually on Apache
+#ENV RT_TEST_WEB_HANDLER=apache+fcgid
+#ENV HTTPD_ROOT=/etc/apache2
+#ENV RT_TEST_APACHE=/usr/sbin/apache2
+#ENV RT_TEST_APACHE_MODULES=/usr/lib/apache2/modules
+
+# Add the rt_test user (required by mod_fcgid tests)
+RUN adduser --disabled-password --gecos "" rt-user
+
 CMD tail -f /dev/null

commit e8a7e1f95f98ab168bafaf1b7e585005c8fc8eeb
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Dec 24 09:18:07 2020 -0500

    Suppress Apache missing ServerName warning during startup

diff --git a/lib/RT/Test/Apache.pm b/lib/RT/Test/Apache.pm
index 3c0bfe0505..991c10d7ba 100644
--- a/lib/RT/Test/Apache.pm
+++ b/lib/RT/Test/Apache.pm
@@ -243,6 +243,7 @@ sub apache_server_info {
         if $mpm;
     print $tmp "ErrorLog /dev/null\n";
     print $tmp "TransferLog /dev/null\n";
+    print $tmp "ServerName localhost\n";
     close $tmp;
     $info = `$res{executable} -V -f $tmp`;
     my %opts = ($info =~ m/^\s*-D\s+([A-Z_]+?)(?:="(.*)")$/mg);

-----------------------------------------------------------------------


More information about the rt-commit mailing list