Exemplo n.º 1
0
import sys
from cbrequest import get_url, configFile, sendrequest, resultCollection, \
        get_apikey, executeCmd, sshToOtherClient, passCmdToPanic, \
        getControllerInfo

from haUtils import change_node_state, ping_machine
import logging

# Get necessary params and values from config file (conf.txt)
conf = configFile(sys.argv)

DEVMAN_IP = conf['host']
USER = conf['username']
PASSWORD = conf['password']

APIKEY = get_apikey(conf)
APIKEY = APIKEY[1]
STDURL = get_url(conf, APIKEY)

Setup = conf['setup']

EC1_IP = conf['EC1_IP']
EC1_Username = conf['EC1_Username']
EC1_Password = conf['EC1_Password']

Node1_IP = conf['Node1_IP']
Node1_Username = conf['Node1_Username']
Node1_Password = conf['Node1_Password']

Node2_IP = conf['Node2_IP']
Node2_Username = conf['Node2_Username']
Exemplo n.º 2
0
testcase = 'Verify NFS share mount/umount alerts(devd logs)'

logging.info('----Start of testcase "%s"----', testcase)

if len(sys.argv) < 2:
    print 'Arguments are not correct, Please provide as follows...\n'
    print 'python NFSAlerts.py conf.txt'
    logging.debug('----Ending script because of parameter mismatch----')
    exit()

resultCollectionNew('\n"%s" testcase starts....' % testcase, ['', ''])
print('----Start of testcase "%s"----' % testcase)

conf = configFile(sys.argv)
apikey = get_apikey(conf)
stdurl = get_url(conf, apikey[1])
tsmIP = conf['ipVSM2']

startTime = ctime()
logging.info('Listing Tsm for given TSMIP "%s" to get its ID', tsmIP)
tsmList = listTSMWithIP_new(stdurl, tsmIP)
if tsmList[0] == 'PASSED':
    logging.info('TSM present with the given IP "%s"', tsmIP)
    logging.info('Getting tsm_name, tsm_id, and dataset_id...')
    get_tsmInfo = get_tsm_info(tsmList[1])
    tsmID = get_tsmInfo[0]
    tsmName = get_tsmInfo[1]
    datasetID = get_tsmInfo[2]
    logging.debug('tsm_name: %s, tsm_id: %s, dataset_id: %s',\
            tsmName, tsmID, datasetID)
Exemplo n.º 3
0
#deprovision it
#verify tsm IOPs after deprovision
#repeat the process for required number of times
#----------------------------------------------------

testcase = 'provisioning and deprovisioning of volumes(NFS and ISCSI)'

logging.info('----Start of testcase "%s"----', testcase)
if len(sys.argv) < 2:
    print "Argument are not correct, Please provide as follows"
    print "python provision_deprovision_nfs_iscsi.py conf.txt "
    logging.debug('----Ending script because of parameter mismatch----')
    exit()

config = configFile(sys.argv)
api_key = get_apikey(config)
stdurl = get_url(config, api_key[1])
otherClientIP = config["Client1_IP"]
tsmIP = config["ipVSM1"]

startTime = ctime()
tsmList = listTSMWithIP_new(stdurl, tsmIP)
endTime = ctime()
if tsmList[0] == 'FAILED':
    logAndresult(testcase, 'BLOCKED', tsmList[1], startTime, endTime)

get_tsmInfo = get_tsm_info(tsmList[1])
tsmID = get_tsmInfo[0]
tsmName = get_tsmInfo[1]
datasetID = get_tsmInfo[2]
accName = tsmList[1][0].get('accountname')