コード例 #1
0
ファイル: avocado-setup.py プロジェクト: harihare/tests
NORUNTEST_PATH = "%s/config/wrapper/no_run_tests.conf" % BASE_PATH
TEST_CONF_PATH = "%s/config/tests/" % BASE_PATH
CONFIGFILE = configparser.SafeConfigParser()
CONFIGFILE.read(CONFIG_PATH)
NORUNTESTFILE = configparser.SafeConfigParser()
NORUNTESTFILE.read(NORUNTEST_PATH)
INPUTFILE = configparser.SafeConfigParser()
INPUTFILE.optionxform = str
AVOCADO_REPO = CONFIGFILE.get('repo', 'avocado')
AVOCADO_VT_REPO = CONFIGFILE.get('repo', 'avocado_vt')
TEST_REPOS = CONFIGFILE.get('repo', 'tests').split(',')
TEST_DIR = "%s/tests" % BASE_PATH
DATA_DIR = "%s/data" % BASE_PATH
LOG_DIR = "%s/results" % BASE_PATH

logger = logger_init(filepath=BASE_PATH).getlogger()


class TestSuite():
    guest_add_args = ""
    host_add_args = ""

    def __init__(self,
                 name,
                 resultdir,
                 vt_type,
                 test=None,
                 mux=None,
                 args=None):
        self.id = binascii.b2a_hex(os.urandom(20)).decode()
        self.name = str(name)
コード例 #2
0
# Matrix
# Copyright (c) 2011-2016, Eric Trudeau <*****@*****.**>.  All rights reserved.
# This file and the Matrix project is licensed under the BSD 3-Clause License
# http://opensource.org/licenses/BSD-3-Clause

import os
import re
import datetime

from config.settings_emc_vnx_block import NAVISECCLI_PATH

from lib.logger import logger_init
from lib.regex import re_find

logger = logger_init('matrix.collector.linux.emc_vnx_block')


def analyzer_list(raw):
	''' 
	Index Size in KB     Last Modified            Filename
	0     157860    08/13/2015 21:42:25  APM00000001234_SPA_2015-08-14_02-38-46-GMT_M06-00.nar
	1     159413    08/14/2015 10:42:19  APM00000001234_SPA_2015-08-14_15-38-46-GMT_M06-00.nar
	2     158278    08/14/2015 23:42:14  APM00000001234_SPA_2015-08-15_04-38-44-GMT_M06-00.nar
	'''

	raw_parsed = re.findall(r'(\d+)\s+(\d+)\s+(\d{2}/\d{2}/\d{4}\s\d{2}:\d{2}:\d{2})\s+(APM(?:\d+)_SP[AB]_[-_\w]+.nar)', raw)

	r = []
	for row in raw_parsed:
		r.append({
			'index'		: row[0],
コード例 #3
0
import sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

from .settings_secure import *

# logging
LOG_DIR = '/var/log'
MATRIX_LOG = os.path.join(LOG_DIR, 'matrix.log')
LOGGING_DEFAULT_NAME	= 'matrix'
LOGGING_LEVEL			= 'DEBUG'	# DEBUG, ERROR, WARN, INFO, etc
LOGGING_CONSOLE			= False		# show output to console where running script


# logging (must be after MATRIX_LOG definition!!)
from lib.logger import logger_init
logger = logger_init('matrix.settings')




from lib.dir import ensure_dir


# main options
COLLECT_BROCADE		= True
COLLECT_EMC_VNX		= True
COLLECT_CML			= False
COLLECT_MITREND		= False
DEBUG_OVERRIDE		= False

コード例 #4
0
# Written by [email protected]
# v2.0 20140326
# Copyright 2014 Eric Trudeau

import os

if __name__ == "__main__":
	os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")

from django.conf import settings

from lib.logger import logger_init

from fabric.api import local  #, cd, run, env, sudo
from fabric.context_managers import settings as fab_settings


logger = logger_init('matrix.collector.linux.functions.fab')

def fab_run_local(cmd):
	logger.debug('fab_run_local  cmd: %s' % cmd)

	with fab_settings(warn_only=True):
		# run command
		r = local(cmd, capture=True)

		# log output
		logger.debug('fab_run_local  output: %s' % r)

		return r
コード例 #5
0
TEST_CONF_PATH = "%s/config/tests/" % BASE_PATH
CONFIGFILE = ConfigParser.SafeConfigParser()
CONFIGFILE.read(CONFIG_PATH)
NORUNTESTFILE = ConfigParser.SafeConfigParser()
NORUNTESTFILE.read(NORUNTEST_PATH)
INPUTFILE = ConfigParser.SafeConfigParser()
INPUTFILE.optionxform = str
AVOCADO_REPO = CONFIGFILE.get('repo', 'avocado')
AVOCADO_VT_REPO = CONFIGFILE.get('repo', 'avocado_vt')
TEST_REPOS = CONFIGFILE.get('repo', 'tests').split(',')
REPOS = [AVOCADO_REPO, AVOCADO_VT_REPO]
TEST_DIR = "%s/tests" % BASE_PATH
DATA_DIR = "%s/data" % BASE_PATH
LOG_DIR = "%s/results" % BASE_PATH

logger = logger_init(filepath=BASE_PATH).getlogger()


class TestSuite():
    guest_add_args = ""
    host_add_args = ""

    def __init__(self, name, resultdir, vt_type, test=None, mux=None):
        self.id = binascii.b2a_hex(os.urandom(20))
        self.name = str(name)
        self.shortname = "_".join(self.name.split('_')[1:])
        self.job_dir = None
        self.type = str(name.split('_')[0])
        self.resultdir = resultdir
        self.conf = None
        self.test = test