Controls services on the dut.
docs that helped write this page
def test_fun(duthosts, rand_one_dut_hostname):
duthost = duthosts[rand_one_dut_hostname]
duthost.service(name="ntp", state="stopped")
name
- name of the service- Required:
True
- Type:
String
- Required:
arguments
- additional arguments provided to cli.- Required:
False
- Type:
String
- Aliases:
args
- Required:
enabled
- Whether service should start on system boot- Required:
True
ifstate
is not defined,False
otherwise - Type:
Boolean
- Required:
pattern
- substring that will be matched against the output of theps
command in the even that the service does not respond to thestatus
command. If the substring is found, the service is considered up.- Required:
False
- Type:
String
- Required:
sleep
- In the event thatstate=restarted
, the number of seconds provided will pass between the stop and start command for the service- Required:
False
- Type:
Integer
- Required:
state
- Desired state for the service- Required:
True
ifenabled
is not defined,False
otherwise - Type:
String
- Choices:
reloaded
- reloads config for servicerestarted
- turns service off completely and back onstarted
- turns service on if not alraedy onstopped
- turns service off if not already off
- Required:
use
- modules used to manage service- Required:
False
- Type:
String
- Default:
auto
- Required:
Provides no useful output. Will error if bad args are provided.