21
21
# IBM_PROLOG_END_TAG
22
22
#
23
23
24
+ # @package OpTestVIOS
25
+ # This class contains common functions for Virtual IO Server(VIOS)
26
+
24
27
import os
25
28
import re
26
29
import time
31
34
log = OpTestLogger .optest_logger_glob .get_logger (__name__ )
32
35
33
36
class OpTestVIOS ():
37
+ '''
38
+ Utility and functions of Virtual I/O Server(VIOS) object
39
+ '''
34
40
35
41
36
42
def __init__ (self , vios_name , vios_ip , vios_username , vios_password , conf = None ):
@@ -45,6 +51,15 @@ def set_system(self, system):
45
51
self .ssh .set_system (system )
46
52
47
53
def gather_logs (self , list_of_commands = [], output_dir = None ):
54
+ '''
55
+ Gather logs - this function gathers default information like version,
56
+ ioslevel, errlog, snap and custom commands given through parameter
57
+ 'list of commands'
58
+
59
+ :param list_of_commands: list, of commands for which output to be logged
60
+ :output_dir: string, to store the gatherd logs
61
+ :returns: True on success, Command Failed exception on failed
62
+ '''
48
63
if not output_dir :
49
64
output_dir = "Vios_Logs_%s" % (time .asctime (time .localtime ())).replace (" " , "_" )
50
65
output_dir = os .path .join (self .conf .host ().results_dir , output_dir , self .name )
@@ -69,4 +84,10 @@ def gather_logs(self, list_of_commands=[], output_dir=None):
69
84
raise cmd_failed
70
85
71
86
def run_command (self , cmd , timeout = 60 ):
87
+ '''
88
+ Wrapper for running ssh.run_command
89
+
90
+ :param cmd: string, command to run
91
+ :param timeout: number, number of seconds for timeout
92
+ '''
72
93
return self .ssh .run_command (cmd , timeout )
0 commit comments