Rahul Maheshwari | d4d43fc | 2019-06-24 00:54:19 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Module to test IPMI chipher functionality. |
| 3 | Resource ../lib/ipmi_client.robot |
| 4 | Resource ../lib/openbmc_ffdc.robot |
| 5 | Library ../lib/ipmi_utils.py |
| 6 | Variables ../data/ipmi_raw_cmd_table.py |
| 7 | |
| 8 | Test Teardown FFDC On Test Case Fail |
| 9 | |
| 10 | *** Variables *** |
| 11 | |
| 12 | |
| 13 | *** Test Cases *** |
| 14 | |
| 15 | Verify Supported Cipher List |
| 16 | [Documentation] Execute all supported cipher levels and verify. |
| 17 | [Tags] Verify_Supported_Cipher_List |
| 18 | :FOR ${cipher_level} IN @{valid_cipher_list} |
| 19 | \ ${status} ${output}= Run Keyword And Ignore Error |
| 20 | ... Run External IPMI Standard Command power status C=${cipher_level} |
| 21 | \ Should Be Equal ${status} PASS msg=${output} values=False |
| 22 | |
| 23 | |
| 24 | Verify Unsupported Cipher List |
| 25 | [Documentation] Execute all unsupported cipher levels and verify error. |
| 26 | [Tags] Verify_Unsupported_Cipher_List |
| 27 | :FOR ${cipher_level} IN @{unsupported_cipher_list} |
| 28 | \ ${status} ${output}= Run Keyword And Ignore Error |
| 29 | ... Run External IPMI Standard Command power status C=${cipher_level} |
| 30 | \ Should Be Equal ${status} FAIL values=False |
| 31 | ... msg=ipmitool execution with cipher suite value of ${cipher_level} should have failed. |
| 32 | |
| 33 | |
| 34 | Verify Supported Cipher List Via Lan Print |
| 35 | [Documentation] Verify supported cipher list via IPMI lan print command. |
| 36 | [Tags] Verify_Supported_Cipher_List_Via_Lan_Print |
| 37 | ${network_info_dict}= Get Lan Print Dict |
| 38 | # Example 'RMCP+ Cipher Suites' entry: 3,17 |
| 39 | ${cipher_list}= Evaluate |
| 40 | ... list(map(int, $network_info_dict['RMCP+ Cipher Suites'].split(','))) |
| 41 | Lists Should Be Equal ${cipher_list} ${valid_cipher_list} |
| 42 | |
| 43 | |
| 44 | Verify Supported Cipher Via Getciphers |
| 45 | [Documentation] Verify supported chiper list via IPMI getciphers command. |
| 46 | [Tags] Verify_Supported_Cipher_Via_Getciphers |
| 47 | ${output}= Run IPMI Standard Command channel getciphers ipmi |
| 48 | # Example of getciphers command output: |
| 49 | # ID IANA Auth Alg Integrity Alg Confidentiality Alg |
| 50 | # 3 N/A hmac_sha1 hmac_sha1_96 aes_cbc_128 |
| 51 | # 17 N/A hmac_sha256 sha256_128 aes_cbc_128 |
| 52 | |
| 53 | ${report}= Outbuf To Report ${output} |
| 54 | # Make list from the 'id' column in the report. |
| 55 | ${cipher_list}= Evaluate [int(x['id']) for x in $report] |
| 56 | Lists Should Be Equal ${cipher_list} ${valid_cipher_list} |
| 57 | |
| 58 | |
| 59 | *** Keywords *** |
| 60 | |