xref: /openbmc/openbmc-test-automation/lib/external_intf/management_console_utils.robot (revision 1faaa4601978578ad70613514952fda28b3296b7)
1c5e9ebc6SSushil Singh*** Settings ***
2c5e9ebc6SSushil SinghDocumentation    Management console utilities keywords.
3c5e9ebc6SSushil Singh
4c5e9ebc6SSushil SinghLibrary          ../../lib/gen_robot_valid.py
5c5e9ebc6SSushil SinghLibrary          Collections
6c5e9ebc6SSushil SinghLibrary          ../../lib/bmc_ssh_utils.py
7c5e9ebc6SSushil SinghLibrary          SSHLibrary
8c5e9ebc6SSushil Singh
9c5e9ebc6SSushil Singh*** Variables ***
10c5e9ebc6SSushil Singh&{daemon_command}  start=systemctl start avahi-daemon
11c5e9ebc6SSushil Singh                  ...  stop=systemctl stop avahi-daemon
12c5e9ebc6SSushil Singh                  ...  status=systemctl status avahi-daemon -l
13c5e9ebc6SSushil Singh&{daemon_message}  start=Active: active (running)
14c5e9ebc6SSushil Singh                  ...  stop=Active: inactive (dead)
15c5e9ebc6SSushil Singh
16c5e9ebc6SSushil Singh*** Keywords ***
17c5e9ebc6SSushil Singh
18c5e9ebc6SSushil SinghSet AvahiDaemon Service
19c5e9ebc6SSushil Singh    [Documentation]  To enable or disable avahi service.
20c5e9ebc6SSushil Singh    [Arguments]  ${command}
21c5e9ebc6SSushil Singh
22c5e9ebc6SSushil Singh    # Description of argument(s):
23*1faaa460SGeorge Keishing    # command  Get command from dictionary.
24c5e9ebc6SSushil Singh
25c5e9ebc6SSushil Singh    ${service_command}=  Get From Dictionary  ${daemon_command}  ${command}
26c5e9ebc6SSushil Singh    ${resp}  ${stderr}  ${rc}=  BMC Execute Command  ${service_command}  print_out=1
27c5e9ebc6SSushil Singh    Should Be Equal As Integers  ${rc}  0
28c5e9ebc6SSushil Singh
29c5e9ebc6SSushil Singh
30c5e9ebc6SSushil SinghVerify AvahiDaemon Service Status
31c5e9ebc6SSushil Singh    [Documentation]  To check for avahi service.
32c5e9ebc6SSushil Singh    [Arguments]  ${message}
33c5e9ebc6SSushil Singh
34c5e9ebc6SSushil Singh    # Description of argument(s):
35*1faaa460SGeorge Keishing    # message  Get status message from dictionary.
36c5e9ebc6SSushil Singh
37c5e9ebc6SSushil Singh    ${service_command}=  Get From Dictionary  ${daemon_command}  status
38c5e9ebc6SSushil Singh    ${service_message}=  Get From Dictionary  ${daemon_message}  ${message}
39c5e9ebc6SSushil Singh    ${resp}  ${stderr}  ${rc}=  BMC Execute Command  ${service_command}  print_out=1
40c5e9ebc6SSushil Singh    Should Contain  ${resp}  ${service_message}
41