diff --git a/buildconf/integration-tests.ini b/buildconf/integration-tests.ini index 42a8f49de..c5295af20 100644 --- a/buildconf/integration-tests.ini +++ b/buildconf/integration-tests.ini @@ -1,4 +1,4 @@ [uwsgi] inherit = base main_plugin = -plugins = notfound,python,php,pypy,jvm,jwsgi,psgi +plugins = notfound,python,php,pypy,jvm,jwsgi,psgi,cgi diff --git a/t/cgi/hello.cgi b/t/cgi/hello.cgi new file mode 100755 index 000000000..b3e56cfcc --- /dev/null +++ b/t/cgi/hello.cgi @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "Content-Type: text/plain" +echo +echo "Hello world!" +echo "PATH_INFO=${PATH_INFO}" diff --git a/t/runner b/t/runner index 5e074c69e..92933fc1f 100755 --- a/t/runner +++ b/t/runner @@ -187,6 +187,20 @@ class UwsgiTest(unittest.TestCase): with requests.get(f"http://{UWSGI_HTTP}/") as r: self.assertEqual(r.text, "Hello, world!") + @unittest.skipUnless(*plugins_available(["cgi"])) + def test_psgi_helloworld(self): + self.start_listen_server( + [ + "--plugins", + "0:cgi", + "--cgi", + os.path.join(TESTS_DIR, "cgi", "hello.cgi"), + ] + ) + + with requests.get(f"http://{UWSGI_HTTP}/foobar/say_hello") as r: + self.assertEqual(r.text, "Hello world!\nPATH_INFO=/foobar/say_hello\n") + if __name__ == "__main__": unittest.main()