Skip to content

seamustuohy/commotion-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. 

About

A small test suite for getting node information on a demonstration or pop-up mesh network.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages