| 167 | |
| 168 | |
| 169 | class MarvinCli(cmd.Cmd, object): |
| 170 | |
| 171 | def __init__(self): |
| 172 | self.__configFile = None |
| 173 | self.__deployFlag = False |
| 174 | self.__zone = None |
| 175 | self.__hypervisorType = None |
| 176 | self.__tcPath = None |
| 177 | self.__testClient = None |
| 178 | self.__tcRunLogger = None |
| 179 | self.__parsedConfig = None |
| 180 | self.__resultStream = None |
| 181 | self.__logFolderPath = None |
| 182 | self.__testRunner = None |
| 183 | self.__requiredHw = False |
| 184 | self.__csFolder = "." |
| 185 | cmd.Cmd.__init__(self) |
| 186 | |
| 187 | @VerifyAndExit( |
| 188 | "cmd failed, may be invalid input options, please check help") |
| 189 | def parse_input_deploy(self, inputs=None): |
| 190 | ''' |
| 191 | Parses,reads the options and verifies for the config file |
| 192 | ''' |
| 193 | if inputs: |
| 194 | out_dict = {} |
| 195 | args = inputs.strip().split(' ') |
| 196 | for item in args: |
| 197 | (key, value) = item.split('=') |
| 198 | out_dict[key] = value |
| 199 | self.__configFile = out_dict.get('config-file', '') |
| 200 | if not self.__configFile: |
| 201 | return FAILED |
| 202 | print("\n==== Parsing Input Options Successful ====") |
| 203 | return SUCCESS |
| 204 | return FAILED |
| 205 | |
| 206 | @VerifyAndExit( |
| 207 | "cmd failed, may be invalid input options, please check help") |
| 208 | def parse_input_runtcs(self, inputs): |
| 209 | ''' |
| 210 | Parses,reads the options and verifies for the config file |
| 211 | ''' |
| 212 | if inputs: |
| 213 | out_dict = {} |
| 214 | args = inputs.strip().split(' ') |
| 215 | for item in args: |
| 216 | (key, value) = item.split('=') |
| 217 | out_dict[key] = value |
| 218 | self.__configFile = out_dict.get('config-file', None) |
| 219 | self.__zone = out_dict.get("zone", None) |
| 220 | self.__hypervisorType = out_dict.get("hyp-type", None) |
| 221 | self.__tcPath = out_dict.get("tc-path",) |
| 222 | self.__requiredHw = out_dict.get("required-hardware") |
| 223 | if not all([self.__tcPath, self.__configFile]): |
| 224 | return FAILED |
| 225 | print("\n==== Parsing Input Options Successful ====") |
| 226 | return SUCCESS |