summaryrefslogtreecommitdiff
path: root/case/multi_step/b_allow_http_tests.robot
blob: 290f1bcf1013eaf2687d89e82403c9e56164ea6a (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
*** Settings ***
Force Tags        tsg_adc_wp    security_policy    adc_verify
Library           OperatingSystem
Resource          ../../keyword/common/systemcommand.robot
Resource          ../../keyword/common/log_variable.robot
Resource          ../../keyword/common/file_operation.robot
Resource          ../../keyword/objects/object.robot
Resource          ../../keyword/policys/policy.robot
Resource          ../../other/all_flow_case_variable.txt

*** Test Cases ***
security_policy_allow_http-00001
    Comment    功能端验证HTTP验证
    ${commandstr}    run keyword if    '${systemType}'=='Windows'    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001.bat
    ...    ELSE    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_L.bat
    ${stringlist}    run keyword if    '${systemType}'=='Windows'    Create List    COVID
    ...    ELSE    Create List    COVID
    ${rescode}    SystemCommands    ${commandstr}    ${stringlist}
    Comment    改变allow策略
    ${policyDict}    Create Dictionary    policyId=${allow_http_policyId}    source=${allow_http_objectId3}|TSG_SECURITY_SOURCE_LOCATION     policyName=security_policy_allow_http-00001-1    policyType=tsg_security    policyDesc=autotest    action=allow    userRegion={"protocol":"HTTP"}    filterList=${allow_http_objectId4}|TSG_FIELD_HTTP_HOST,${allow_http_objectId5}|TSG_FIELD_HTTP_URL    isValid=${1}    appIdObjects=${HTTP_ID}
    log    ${policyDict}
    ${rescode}    UpdatePolicies    1    ${policyDict}    v2    update
    sleep    5   
    Comment    功能端验证HTTP验证
    ${commandstr}    run keyword if    '${systemType}'=='Windows'    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1.bat
    ...    ELSE    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00001_1_L.bat
    ${stringlist}    run keyword if    '${systemType}'=='Windows'    Create List    首页 - 橙光
    ...    ELSE    Create List    首页 - 橙光
    ${rescode}    SystemCommands    ${commandstr}    ${stringlist}

security_policy_allow_http-00002
    Comment    功能端验证HTTP验证
    ${commandstr}    run keyword if    '${systemType}'=='Windows'    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002.bat
    ...    ELSE    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_L.bat
    ${stringlist}    run keyword if    '${systemType}'=='Windows'    Create List    ScoutBahamas.org
    ...    ELSE    Create List    ScoutBahamas.org
    ${rescode}    SystemCommands    ${commandstr}    ${stringlist}
    Comment    改变allow策略
    log    ${allow_http_policyId1}    
    ${policyDict}    Create Dictionary    policyId=${allow_http_policyId1}    policyName=security_policy_allow_http-00002-1    policyType=tsg_security    policyDesc=autotest    action=allow    userRegion={"protocol":"HTTP"}    filterList=${allow_http_objectId7}|TSG_FIELD_HTTP_HOST,${allow_http_objectId8}|TSG_FIELD_HTTP_URL    isValid=${1}    appIdObjects=${HTTP_ID}
    log    ${policyDict}
    ${rescode}    UpdatePolicies    1    ${policyDict}    v2    update
    sleep    5
    Comment    功能端验证HTTP验证
    ${commandstr}    run keyword if    '${systemType}'=='Windows'    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_1.bat
    ...    ELSE    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_1L.bat
    ${stringlist}    run keyword if    '${systemType}'=='Windows'    Create List    女生小说-香网小说网
    ...    ELSE    Create List    女生小说-香网小说网
    ${rescode}    SystemCommands    ${commandstr}    ${stringlist}   
    
security_policy_allow_http-00003
    Comment    开启allow策略
    ${policyDict}    Create Dictionary    policyId=${allow_http_policyId2}    policyName=security_policy_allow_http-00003-1    policyType=tsg_security    policyDesc=autotest    action=allow    userRegion={"protocol":"HTTP"}      isValid=${1}    appIdObjects=${HTTP_ID}
    log    ${policyDict}
    ${rescode}    UpdatePolicies    1    ${policyDict}    v2    update
    sleep    ${policyModifySleepSeconds}
    Comment    功能端验证HTTP验证
    ${commandstr}    run keyword if    '${systemType}'=='Windows'    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002.bat
    ...    ELSE    set variable    ${curlbatpath}/command/SecurityPolicy_Allow_HTTP_00002_L.bat
    ${stringlist}    run keyword if    '${systemType}'=='Windows'    Create List    ScoutBahamas.org
    ...    ELSE    Create List    ScoutBahamas.org
    ${rescode}    SystemCommands    ${commandstr}    ${stringlist}
    Comment    关闭allow策略
    ${policyDict}    Create Dictionary    policyId=${allow_http_policyId2}    policyName=security_policy_allow_http-00003-2    policyType=tsg_security    policyDesc=autotest    action=allow    userRegion={"protocol":"HTTP"}      isValid=${0}    appIdObjects=${HTTP_ID}
    log    ${policyDict}
    ${rescode}    UpdatePolicies    1    ${policyDict}    v2    update
    sleep    ${policyModifySleepSeconds}