Runs a shell command via the sonichost associated with the ASIC instance calling the method.
def test_fun(duthosts, rand_one_dut_hostname, enum_frontend_asic_index):
duthost = duthosts[rand_one_dut_hostname]
sonic_asic = duthost.asic_instance(asic_index=enum_frontend_asic_index)
bgp_info = sonic_asic.shell("ls -ltr")
chdir- change into specified directory before running command- Required:
False - Type:
String
- Required:
cmd- The command to be run as a string with space dilineated options.- Required:
Trueif free-form argument is not provided,Falseotherwise - Type:
String
- Required:
creates- filename. If a matching file already exists, command will not be run.- Required:
False - Type:
String
- Required:
removes- filename. If matching file exists, command will be run- Required:
False - Type:
String
- Required:
stdin- Set the stdin command directly to the specified value- Required:
False - Type:
String
- Required:
stdin_add_newline- ifTrue, newline is appended to stdin data- Required:
False - Type:
Boolean - Default:
True
- Required:
warn- Enable or disable task warnings (deprecated)- Required:
False - Type:
Boolean - Default:
False
- Required:
See the shell Ansible module for example output.