Giter VIP home page Giter VIP logo

commotion-test's Introduction

This suite will allow you to define a set of nodes and servers running commotion to get some basic info about their status from a central point. This test suite should be run from the same point on the network every time to get consistant results.  You should also gather the network configuration information from whatever ad-hoc protocol you are using furing each test. If you don't gather network configuration information as well the results will be very hard to parse after the fact. (I also suggest making a pysical map of the space with notes about the materials and barriers between the nodes to give context when you look back at this data.)


============================
Dependencies:
============================
* Python 2.6-7

============================
How to run tests:
=============================
python run_tests.py [flags]


============================
Flags:
============================
-s [option]
Suite:This flag chooses a specific test suite. Currently only "all" is implemented

-v [level]
Verbose: This flag sets the verbosity level to 2. This will show passed tests in the log file. Otherwise only failed tests and standard metric output is shown in the logfiles.

-l [name]
LogFile: This flag will allow you to choose a non-standard logfile name.


============================
Config File:
============================
should be in the location:
commotion-test/config
should have the following format:
node=123.546.789.10
server=867.530.9.0
server=777.777.777.777
node=666.666.666.666


=============================
To Create a new test set: Copy this bare unittest into your code and go from there.
============================

import unittest
import os, time  #setUp and tearDown requirements

class testFunctions(unittest.TestCase):

    def setUp(self):
	num = 1
        date_string = time.strftime("%Y-%m-%d")
	metric_dir = "logs/"+date_string+"("+str(num)+")"
	while os.path.isdir("logs/"+date_string+"("+str(num+1)+")"):
            num += 1
            metric_dir = "logs/"+date_string+"("+str(num)+")"
        self.log = open(metric_dir+"/THIS_IS_THE_METRIC_FILE_NAME_YOU_WANT", "a")
		self.log.write(time.strftime("Test Time: %Y-%m-%d %H:%M:%S"))

    def tearDown(self):
        self.log.close()

    def test_A_thing(self):

    self.log.write("This is how you write to the metrics file")
	#Note: Don't write any unittest assertions that may fail with one, but not all devices. Run your assertion tests after getting the metric data from your nodes so that a failure does not halt the metric gathering. 

commotion-test's People

Contributors

hawkinswnaf avatar

Watchers

 avatar  avatar  avatar

Forkers

hawkinswnaf

commotion-test's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.