Esempio n. 1
0
 def test_h2_105_10(self, env):
     # just a check without delays if all is fine
     conf = H2Conf(env)
     conf.add_vhost_cgi()
     conf.install()
     assert env.apache_restart() == 0
     url = env.mkurl("https", "cgi", "/h2test/delay")
     piper = CurlPiper(env=env, url=url)
     piper.start()
     stdout, stderr = piper.close()
     assert piper.exitcode == 0
     assert len("".join(stdout)) == 3 * 8192
Esempio n. 2
0
 def test_h2_105_12(self, env):
     # long connection timeout, short stream timeout
     # sending a slow POST
     conf = H2Conf(env)
     conf.add_vhost_cgi()
     conf.add("Timeout 10")
     conf.add("H2StreamTimeout 1")
     conf.install()
     assert env.apache_restart() == 0
     url = env.mkurl("https", "cgi", "/h2test/delay?5")
     piper = CurlPiper(env=env, url=url)
     piper.start()
     for _ in range(3):
         time.sleep(2)
         try:
             piper.send("0123456789\n")
         except BrokenPipeError:
             break
     piper.close()
     assert piper.response
     assert piper.response['status'] == 408
Esempio n. 3
0
 def test_h2_105_11(self, env):
     # short connection timeout, longer stream delay
     # receiving the first response chunk, then timeout
     conf = H2Conf(env)
     conf.add_vhost_cgi()
     conf.add("Timeout 1")
     conf.install()
     assert env.apache_restart() == 0
     url = env.mkurl("https", "cgi", "/h2test/delay?5")
     piper = CurlPiper(env=env, url=url)
     piper.start()
     stdout, stderr = piper.close()
     assert len("".join(stdout)) == 8192