[Privoxy-commits] [privoxy] 02/26: Add cts scenario "pcrs"
User Git
git at git.privoxy.org
Sat Oct 10 09:01:28 CEST 2026
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository privoxy.
commit 007b5b75b2572823068af2dfa3932cbeef30c209
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Sat Sep 5 12:23:50 2026 +0200
Add cts scenario "pcrs"
---
tests/cts/pcrs/data/DISABLED | 1 +
tests/cts/pcrs/data/test1 | 62 +++++++++++++++++++++++++++++++++++++++
tests/cts/pcrs/data/test2 | 61 ++++++++++++++++++++++++++++++++++++++
tests/cts/pcrs/data/test3 | 70 ++++++++++++++++++++++++++++++++++++++++++++
tests/cts/pcrs/data/test4 | 62 +++++++++++++++++++++++++++++++++++++++
tests/cts/pcrs/data/test5 | 62 +++++++++++++++++++++++++++++++++++++++
tests/cts/pcrs/data/test6 | 61 ++++++++++++++++++++++++++++++++++++++
tests/cts/pcrs/pcrs.action | 17 +++++++++++
tests/cts/pcrs/pcrs.filter | 21 +++++++++++++
tests/cts/pcrs/privoxy.conf | 17 +++++++++++
10 files changed, 434 insertions(+)
diff --git a/tests/cts/pcrs/data/DISABLED b/tests/cts/pcrs/data/DISABLED
new file mode 100644
index 00000000..da43e6a4
--- /dev/null
+++ b/tests/cts/pcrs/data/DISABLED
@@ -0,0 +1 @@
+# Don't disable any tests.
diff --git a/tests/cts/pcrs/data/test1 b/tests/cts/pcrs/data/test1
new file mode 100644
index 00000000..c835c54c
--- /dev/null
+++ b/tests/cts/pcrs/data/test1
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+PCRS submatch limit reached
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+ab
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+Content-Length: 2
+
+b
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
++filter{submatch-limit-not-reached}
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/submatch-limit-not-reached/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /submatch-limit-not-reached/%TESTNUMBER HTTP/1.1%CR
+Host: %HOSTIP:%HTTPPORT%CR
+User-Agent: curl/%VERSION%CR
+Accept: */*%CR
+Connection: close%CR
+%CR
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/cts/pcrs/data/test2 b/tests/cts/pcrs/data/test2
new file mode 100644
index 00000000..3f12b81e
--- /dev/null
+++ b/tests/cts/pcrs/data/test2
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+PCRS submatch limit not reached
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+ab
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+ab
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
++filter{submatch-limit-reached}
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/submatch-limit-reached/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /submatch-limit-reached/%TESTNUMBER HTTP/1.1%CR
+Host: %HOSTIP:%HTTPPORT%CR
+User-Agent: curl/%VERSION%CR
+Accept: */*%CR
+Connection: close%CR
+%CR
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/cts/pcrs/data/test3 b/tests/cts/pcrs/data/test3
new file mode 100644
index 00000000..ba13607e
--- /dev/null
+++ b/tests/cts/pcrs/data/test3
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Dynamic filter with variables
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+host variable:
+listen-address variable:
+origin variable:
+path variable:
+url variable:
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+Content-Length: 181
+
+host variable: 127.0.0.1
+listen-address variable: 127.0.0.1:9119
+origin variable: 127.0.0.1
+path variable: /embed-variables/%TESTNUMBER
+url variable: http://%HOSTIP:%HTTPPORT/embed-variables/%TESTNUMBER
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
++filter{embed-variables}
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/embed-variables/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /embed-variables/%TESTNUMBER HTTP/1.1%CR
+Host: %HOSTIP:%HTTPPORT%CR
+User-Agent: curl/%VERSION%CR
+Accept: */*%CR
+Connection: close%CR
+%CR
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/cts/pcrs/data/test4 b/tests/cts/pcrs/data/test4
new file mode 100644
index 00000000..b91498a0
--- /dev/null
+++ b/tests/cts/pcrs/data/test4
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Filter with multiple submatches that are being referenced in the substitution text.
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+1 2 3 4 5 6 7 8 9
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+Content-Length: 18
+
+9 8 7 6 5 4 3 2 1
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
++filter{submatches-used}
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/submatches-used/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /submatches-used/%TESTNUMBER HTTP/1.1%CR
+Host: %HOSTIP:%HTTPPORT%CR
+User-Agent: curl/%VERSION%CR
+Accept: */*%CR
+Connection: close%CR
+%CR
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/cts/pcrs/data/test5 b/tests/cts/pcrs/data/test5
new file mode 100644
index 00000000..6fcc2c6c
--- /dev/null
+++ b/tests/cts/pcrs/data/test5
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Filter with multiple submatches that are being referenced in the pattern
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 31 31
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+Content-Length: 5
+
+Yay!
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
++filter{submatches-referenced}
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/submatches-referenced/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /submatches-referenced/%TESTNUMBER HTTP/1.1%CR
+Host: %HOSTIP:%HTTPPORT%CR
+User-Agent: curl/%VERSION%CR
+Accept: */*%CR
+Connection: close%CR
+%CR
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/cts/pcrs/data/test6 b/tests/cts/pcrs/data/test6
new file mode 100644
index 00000000..baf1c899
--- /dev/null
+++ b/tests/cts/pcrs/data/test6
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+Filter with multiple submatches that are being referenced in the pattern
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Does not matter.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 22 Jul 2010 11:22:33 GMT
+Connection: close
+Content-Type: text/html
+X-Control: swsclose
+
+Does not matter.
+</data>
+</proxy-reply>
+
+
+<client>
+<server>
+http
+</server>
+<name>
++filter{lots-of-parentheses}
+</name>
+<features>
+proxy
+</features>
+<command>
+http://%HOSTIP:%HTTPPORT/lots-of-parentheses/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /lots-of-parentheses/%TESTNUMBER HTTP/1.1%CR
+Host: %HOSTIP:%HTTPPORT%CR
+User-Agent: curl/%VERSION%CR
+Accept: */*%CR
+Connection: close%CR
+%CR
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/cts/pcrs/pcrs.action b/tests/cts/pcrs/pcrs.action
new file mode 100644
index 00000000..162f9492
--- /dev/null
+++ b/tests/cts/pcrs/pcrs.action
@@ -0,0 +1,17 @@
+{+filter{submatch-limit-not-reached}}
+/submatch-limit-not-reached/
+
+{+filter{submatch-limit-reached}}
+/submatch-limit-reached/
+
+{+filter{embed-variables}}
+/embed-variables/
+
+{+filter{submatches-used}}
+/submatches-used/
+
+{+filter{submatches-referenced}}
+/submatches-referenced/
+
+{+filter{lots-of-parentheses}}
+/lots-of-parentheses/
diff --git a/tests/cts/pcrs/pcrs.filter b/tests/cts/pcrs/pcrs.filter
new file mode 100644
index 00000000..15da4b95
--- /dev/null
+++ b/tests/cts/pcrs/pcrs.filter
@@ -0,0 +1,21 @@
+FILTER: submatch-limit-not-reached Filter with pcrs job that doesn't reach the submatch limit
+s@()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(a)@@
+
+FILTER: submatch-limit-reached Filter with pcrs job that reaches the submatch limit
+s@()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(a)@@
+
+FILTER: embed-variables Filter that uses dynamic variables.
+s@(host variable:)@$1 $host at D
+s@(listen-address variable:)@$1 $listen-address at D
+s@(origin variable:)@$1 $origin at D
+s@(path variable:)@$1 $path at D
+s@(url variable:)@$1 $url at D
+
+FILTER: submatches-used Filter that uses multiple submatches and references them in the substitution
+s@(1) (2) (3) (4) (5) (6) (7) (8) (9)@$9 $8 $7 $6 $5 $4 $3 $2 $1@
+
+FILTER: submatches-referenced Filter that uses multiple submatches and references on of them in the pattern
+s@(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) (21) (22) (23) (24) (25) (26) (27) (28) (29) (30) (31) \31 \31 at Yay!@
+
+FILTER: lots-of-parentheses Filter that would previously trigger OVE-20260829-0001 on some platforms
+s@()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() [...]
diff --git a/tests/cts/pcrs/privoxy.conf b/tests/cts/pcrs/privoxy.conf
new file mode 100644
index 00000000..dd1a8c98
--- /dev/null
+++ b/tests/cts/pcrs/privoxy.conf
@@ -0,0 +1,17 @@
+listen-address 127.0.0.1:9119
+
+debug 1 # Log the destination for each request Privoxy let through. See also debug 1024.
+debug 2 # show each connection status
+debug 4 # show tagging-related messages
+debug 8 # show header parsing
+debug 32 # debug force feature
+debug 64 # debug regular expression filters
+debug 128 # debug redirects
+debug 256 # debug GIF de-animation
+debug 512 # Common Log Format
+debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
+debug 4096 # Startup banner and warnings.
+debug 8192 # Non-fatal errors
+
+filterfile ./pcrs.filter
+actionsfile ./pcrs.action
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Privoxy-commits
mailing list