Exemplo n.º 1
0
def main():
    print "Main function is now running"
    print "When the main fucntion runs, each line will always be reserved for x number of entries"
    global one_time_SWITCH

    if one_time_SWITCH=="True":
        run = TestController() 
        run.runALL_tests()
        one_time_SWITCH="False"
    else:
        print "Run the script once when the program starts - no more"
#  Test script used to verify CPU status of the test PC
#  Recommended to run this script before executing any test suites
#
################################################################################
################################################################################

import sys
sys.path.append("../lib")
from commonlib import *
from TestController import *
import xml.etree.ElementTree as ET
import re
import time
#Custom Test libraries
cLib = CommonLib()
testcontrol = TestController()

################################################################################
#                     Parse the Command Line Arguments
################################################################################
import argparse


def fnTestModule_1():
    cLib.logger(
        "----------------------------------------------------------------------"
    )
    cLib.logger(
        "Module 1: Basic Functionality - Frequency Shift & Negative Load       "
    )
    cLib.logger(
Exemplo n.º 3
0
import sys
sys.path.append("../lib")
from commonlib import *
from TestController import *
import xml.etree.ElementTree as ET
import re
import time
#Custom Test libraries
cLib = CommonLib()
testcontrol = TestController()

tree = ET.parse('food_menu.xml')
root = tree.getroot()
result = False
#print root[0][1].text
#print root[0][2].text

cLib.logger("#####################################################")
cLib.logger("")
cLib.logger("Test Case 1: Verify menu item costs more than $4.00")
cLib.logger("")
cLib.logger("#####################################################")

for food in root.findall('food'):
    name = food.find('name').text
    price = food.find('price').text
    cLib.logger("Food: %s" % name)
    cLib.logger("Price: %s" % price)
    #Use regex to remove $ from price for test
    regex = r"\$"
    float_price = float(re.sub(
Exemplo n.º 4
0
def add_New_Test(input1):
    run = TestController()
    run.addNEW_Test(input1)
Exemplo n.º 5
0
def stop_Test(input1):
    try:
        run = TestController()
        run.stop_Test(input1)
    except AttributeError:
        print "Run test first"
Exemplo n.º 6
0
With the initial Berkeley dataset, we've got some backbone traffic in the data.
As a result, only a few kinds of 'packets' make up most of our data. Using just
IP & Port, roughly 90% (or more) of the traffic is traffic on one of 6 connections.
    (according to raw packet count)
My instinct is generally no, but it might be useful to make KNN's output
more sensible. Possibly. I don't know, this may just be an expected result.
I'm curious if some of the CRAWDAD data will have similar proprties. I assume
it will, if backbone traffic is included. 
"""
    
# Making a ML system and passing to TestController after this point.

kns = KNNSys.KNearestSystem()
knc = KNCSys.KNClassifierSystem()

controller = TestController.TestController(data)
# Working out what the constructor looks like.


#knnResults = controller.run(kns)
 



# Data formatting notes

# The various scikit-learn libraries expect an 'array like' object.
# Fortunately, they can correctly convert a list. So, a list-of-lists is a
# valid object to pass them. We may want to convert to array's at some point
# for memory reasons, but that can be done hear. Below this, I'll probably
# just pass inputs through array() as necessary.