<commit_before><commit_msg>Test BMC web vulnerability<commit_after>*** Settings ***
Documentation    Test bmc web vulnerability.

Resource         ../lib/resource.robot
Resource         ../lib/bmc_redfish_resource.robot
Resource         ../lib/openbmc_ffdc.robot

Test Setup       Test Setup Execution
Test Teardown    FFDC On Test Case Fail

*** Variables ***

${LOOP_COUNT}   4

*** Test Cases ***

Check BMCWeb Service After Attempted GET With Invalid URL
    [Documentation]  Request BMC GET with invalid URL.
    [Tags]  Check_BMCWeb_Service_After_Attempted_GET_With_Invalid_URL

    ${invalid_url}=  Set Variable   https://${OPENBMC_HOST}/'redfish\\['

    # Exhaust bmcweb restart policy by crashing 4 times in succession.
    Repeat Keyword  ${LOOP_COUNT} times  Run  ${curl_tool} -k ${invalid_url}

    # This should fail, if bmcweb is crashed.
    Redfish.Login

*** Keywords ***

Test Setup Execution
    [Documentation]  Do test setup execution.

    ${cmd_tool}=  Run  which curl
    Should Contain  ${cmd_tool}  curl
    Set Test Variable  ${curl_tool}  ${cmd_tool}

{'fraction_non_alphanumeric': 0.09444444444444444, 'fraction_numerical': 0.001851851851851852, 'mean_word_length': 3.3413654618473894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5813337', 'n_tokens_mistral': 348, 'n_tokens_neox': 331, 'n_words': 103}