Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-24.04]
platform: [x32, x64]
compiler: [gcc, clang]
configure:
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Setup Dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y apache2-dev libxml2-dev liblua5.1-0-dev libcurl4-gnutls-dev libpcre2-dev pkg-config libyajl-dev apache2 apache2-bin apache2-data
sudo apt-get install -y apache2-dev libxml2-dev liblua5.1-0-dev libcurl4-gnutls-dev libpcre2-dev libpcre3-dev libpcre3 pkg-config libyajl-dev apache2 apache2-bin apache2-data
- uses: actions/checkout@v2
- name: autogen.sh
run: ./autogen.sh
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-24.04]
platform: [x32, x64]
compiler: [gcc, clang]
configure:
Expand All @@ -97,7 +97,7 @@ jobs:
- name: Setup Dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y --no-install-recommends apache2-dev libxml2-dev liblua5.1-0-dev libcurl4-gnutls-dev libpcre2-dev pkg-config libyajl-dev apache2 apache2-bin apache2-data
sudo apt-get install -y --no-install-recommends apache2-dev libxml2-dev liblua5.1-0-dev libcurl4-gnutls-dev libpcre2-dev libpcre3-dev libpcre3 pkg-config libyajl-dev apache2 apache2-bin apache2-data
- uses: actions/checkout@v2
- name: autogen.sh
run: ./autogen.sh
Expand All @@ -110,3 +110,30 @@ jobs:
run: sudo make install
- name: run tests
run: make test

test-regression-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]
platform: [x64]
compiler: [gcc]
configure:
- {label: "with pcre2, with study, with jit", opt: "--enable-pcre-study=yes --enable-pcre-jit" }
steps:
- name: Setup Dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y --no-install-recommends apache2-dev libxml2-dev liblua5.1-0-dev libcurl4-gnutls-dev libpcre2-dev libpcre3-dev libpcre3 pkg-config libyajl-dev apache2 apache2-bin apache2-data perl libwww-perl ssdeep libfuzzy-dev libfuzzy2
- uses: actions/checkout@v2
- name: autogen.sh
run: ./autogen.sh
- name: configure ${{ matrix.configure.label }}
run: ./configure ${{ matrix.configure.opt }} 'CFLAGS=-Werror=format-security'
- uses: ammaraskar/gcc-problem-matcher@0f9c86f9e693db67dacf53986e1674de5f2e5f28 #v0.3.0
- name: make
run: make -j `nproc`
- name: install module
run: sudo make install
- name: run regression tests
run: make test-regression
8 changes: 4 additions & 4 deletions apache2/msc_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,12 @@ int lua_execute(msc_script *script, char *param, modsec_rec *msr, msre_rule *rul
#else

/* Create new state. */
#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504 || LUA_VERSION_NUM == 501
#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504 || LUA_VERSION_NUM == 505 || LUA_VERSION_NUM == 501
L = luaL_newstate();
#elif LUA_VERSION_NUM == 500
L = lua_open();
#else
#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3, or 5.4.
#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3, 5.4 or 5.5.
#endif
luaL_openlibs(L);

Expand All @@ -463,10 +463,10 @@ int lua_execute(msc_script *script, char *param, modsec_rec *msr, msre_rule *rul
/* Register functions. */
#if LUA_VERSION_NUM == 500 || LUA_VERSION_NUM == 501
luaL_register(L, "m", mylib);
#elif LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504
#elif LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504 || LUA_VERSION_NUM == 505
luaL_setfuncs(L, mylib, 0);
#else
#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3, or 5.4.
#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3, 5.4 or 5.5.
#endif

lua_setglobal(L, "m");
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/config/10-request-directives.t
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
SecRequestBodyLimit 20
),
match_log => {
debug => [ qr/Request body is larger than the configured limit \(20\).. Deny with code \(413\)/, 1 ],
debug => [ qr/Request body is larger than the configured limit \(20\)./, 1 ],
},
match_response => {
status => qr/^413$/,
Expand Down
187 changes: 0 additions & 187 deletions tests/regression/misc/10-tfn-cache.t

This file was deleted.

13 changes: 9 additions & 4 deletions tests/run-regression-tests.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,12 @@ sub match_log {
$rc = $&;
last;
}
# TODO: Use select()/poll()
sleep 0.1 unless ($nbytes == $BUFSIZ);
unless ($nbytes == $BUFSIZ) {
# wait until we can read from the file but max 0.1 secs
my $rin = '';
vec($rin, fileno($fh), 1) = 1;
select($rin, undef, undef, 0.1);
}
if ($graph and $opt{d}) {
$i++;
if ($i == 10) {
Expand Down Expand Up @@ -532,7 +536,8 @@ sub dbg {
my $out = join "", map {
(ref $_ ne "" ? Dumper($_) : $_)
} @_;
$out =~ s/^/DBG: /mg;
my $t = gettimeofday;
$out =~ s/^/DBG\[$t\]: /mg;
print STDOUT "$out\n";
}

Expand Down Expand Up @@ -632,7 +637,7 @@ sub httpd_stop {
-d => $opt{S},
-f => $opt{C},
(map { (-c => $_) } ("Listen localhost:$opt{p}", @_)),
-k => "stop",
-k => "graceful-stop",
);

my $httpd_out;
Expand Down
Loading