当前位置: 首页>>代码示例>>Python>>正文


Python TestEnv.apache_restart方法代码示例

本文整理汇总了Python中TestEnv.TestEnv.apache_restart方法的典型用法代码示例。如果您正苦于以下问题:Python TestEnv.apache_restart方法的具体用法?Python TestEnv.apache_restart怎么用?Python TestEnv.apache_restart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestEnv.TestEnv的用法示例。


在下文中一共展示了TestEnv.apache_restart方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_module

# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import apache_restart [as 别名]
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    HttpdConf(
    ).start_vhost( TestEnv.HTTPS_PORT, "push", docRoot="htdocs/test1", withSSL=True
    ).add_line("""    Protocols h2 http/1.1"

    RewriteEngine on
    RewriteRule ^/006-push(.*)?\.html$ /006.html
    <Location /006-push.html>
        Header add Link "</006/006.css>;rel=preload"
        Header add Link "</006/006.js>;rel=preloadX"
    </Location>
    <Location /006-push2.html>
        Header add Link "</006/006.css>;rel=preloadX, </006/006.js>; rel=preload"
    </Location>
    <Location /006-push3.html>
        Header add Link "</006/006.css>;rel=preloa,</006/006.js>;rel=preload"
    </Location>
    <Location /006-push4.html>
        Header add Link "</006/006.css;rel=preload, </006/006.js>; preload"
    </Location>
    <Location /006-push5.html>
        Header add Link '</006/006.css>;rel="preload push"'
    </Location>
    <Location /006-push6.html>
        Header add Link '</006/006.css>;rel="push preload"'
    </Location>
    <Location /006-push7.html>
        Header add Link '</006/006.css>;rel="abc preload push"'
    </Location>
    <Location /006-push8.html>
        Header add Link '</006/006.css>;rel="preload"; nopush'
    </Location>
    <Location /006-push20.html>
        H2PushResource "/006/006.css" critical
        H2PushResource "/006/006.js"
    </Location>    
    <Location /006-push30.html>
        H2Push off
        Header add Link '</006/006.css>;rel="preload"'
    </Location>
    <Location /006-push31.html>
        H2PushResource "/006/006.css" critical
    </Location>
    <Location /006-push32.html>
        Header add Link "</006/006.css>;rel=preload"
    </Location>
    """).end_vhost(
    ).install()
    assert TestEnv.apache_restart() == 0
开发者ID:covener,项目名称:mod_h2,代码行数:53,代码来源:test_400_push.py

示例2: setup_module

# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import apache_restart [as 别名]
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    HttpdConf(
    ).start_vhost( TestEnv.HTTPS_PORT, "hints", docRoot="htdocs/test1", withSSL=True
    ).add_line("""    Protocols h2 http/1.1"

    H2EarlyHints on
    RewriteEngine on
    RewriteRule ^/006-(.*)?\.html$ /006.html
    <Location /006-hints.html>
        H2PushResource "/006/006.css" critical
    </Location>
    <Location /006-nohints.html>
        Header add Link "</006/006.css>;rel=preload"
    </Location>
    """).end_vhost(
    ).install()
    assert TestEnv.apache_restart() == 0
开发者ID:covener,项目名称:mod_h2,代码行数:21,代码来源:test_401_early_hints.py

示例3: setup_module

# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import apache_restart [as 别名]
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    HttpdConf(
    ).start_vhost( TestEnv.HTTPS_PORT, "ssl", withSSL=True
    ).add_line("      Protocols h2 http/1.1"
    ).add_line("      SSLOptions +StdEnvVars"
    ).add_line("      "
    ).add_line("      <Location /h2only.html>"
    ).add_line("          Require expr \"%{HTTP2} == 'on'\""
    ).add_line("      </Location>"
    ).add_line("      <Location /noh2.html>"
    ).add_line("          Require expr \"%{HTTP2} == 'off'\""
    ).add_line("      </Location>"
    ).end_vhost(
    ).install()
    # the dir needs to exists for the configuration to have effect
    TestEnv.mkpath("%s/htdocs/ssl-client-verify" % TestEnv.WEBROOT)
    assert TestEnv.apache_restart() == 0
开发者ID:covener,项目名称:mod_h2,代码行数:21,代码来源:test_102_require.py

示例4: setup_module

# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import apache_restart [as 别名]
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    HttpdConf().add_vhost_test1().add_vhost_test2().add_vhost_noh2(
    ).start_vhost( TestEnv.HTTPS_PORT, "test3", docRoot="htdocs/test1", withSSL=True
    ).add_line("      Protocols h2 http/1.1"
    ).add_line("      Header unset Upgrade"
    ).end_vhost(
    ).start_vhost( TestEnv.HTTP_PORT, "test1b", docRoot="htdocs/test1", withSSL=False
    ).add_line("      Protocols h2c http/1.1"
    ).add_line("      H2Upgrade off"
    ).add_line("      <Location /006.html>"
    ).add_line("        H2Upgrade on"
    ).add_line("      </Location>"
    ).end_vhost(
    ).install()
        
    # the dir needs to exists for the configuration to have effect
    TestEnv.mkpath("%s/htdocs/ssl-client-verify" % TestEnv.WEBROOT)
    assert TestEnv.apache_restart() == 0
开发者ID:covener,项目名称:mod_h2,代码行数:22,代码来源:test_103_upgrade.py

示例5: setup_module

# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import apache_restart [as 别名]
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    HttpdConf(
    ).add_line("      SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384"
    ).add_line("      <Directory \"%s/htdocs/ssl-client-verify\">" % TestEnv.WEBROOT
    ).add_line("        Require all granted"
    ).add_line("        SSLVerifyClient require"
    ).add_line("        SSLVerifyDepth 0"
    ).add_line("      </Directory>"
    ).start_vhost( TestEnv.HTTPS_PORT, "ssl", withSSL=True
    ).add_line("      Protocols h2 http/1.1"
    ).add_line("      "
    ).add_line("      <Location /renegotiate/cipher>"
    ).add_line("          SSLCipherSuite ECDHE-RSA-CHACHA20-POLY1305"
    ).add_line("      </Location>"
    ).add_line("      <Location /renegotiate/err-doc-cipher>"
    ).add_line("          SSLCipherSuite ECDHE-RSA-CHACHA20-POLY1305"
    ).add_line("          ErrorDocument 403 /forbidden.html"
    ).add_line("      </Location>"
    ).add_line("      <Location /renegotiate/verify>"
    ).add_line("          SSLVerifyClient require"
    ).add_line("      </Location>"
    ).add_line("      <Directory \"%s/htdocs/sslrequire\">" % TestEnv.WEBROOT
    ).add_line("          SSLRequireSSL"
    ).add_line("      </Directory>"
    ).add_line("      <Directory \"%s/htdocs/requiressl\">" % TestEnv.WEBROOT
    ).add_line("          Require ssl"
    ).add_line("      </Directory>"
    ).end_vhost(
    ).install()
    # the dir needs to exists for the configuration to have effect
    TestEnv.mkpath("%s/htdocs/ssl-client-verify" % TestEnv.WEBROOT)
    TestEnv.mkpath("%s/htdocs/renegotiate/cipher" % TestEnv.WEBROOT)
    TestEnv.mkpath("%s/htdocs/sslrequire" % TestEnv.WEBROOT)
    TestEnv.mkpath("%s/htdocs/requiressl" % TestEnv.WEBROOT)
    assert TestEnv.apache_restart() == 0
开发者ID:covener,项目名称:mod_h2,代码行数:39,代码来源:test_101_ssl_reneg.py

示例6: setup_module

# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import apache_restart [as 别名]
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    HttpdConf().add_vhost_cgi().install()
    assert TestEnv.apache_restart() == 0
开发者ID:covener,项目名称:mod_h2,代码行数:7,代码来源:test_200_header_invalid.py

示例7: setup_module

# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import apache_restart [as 别名]
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    TestEnv.setup_data_1k_1m()
    HttpdConf().add_vhost_cgi( h2proxy_self=True  ).install()
    assert TestEnv.apache_restart() == 0
开发者ID:covener,项目名称:mod_h2,代码行数:8,代码来源:test_600_h2proxy.py


注:本文中的TestEnv.TestEnv.apache_restart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。