seamustuohy / commotion-test Goto Github PK
View Code? Open in Web Editor NEWA small test suite for getting node information on a demonstration or pop-up mesh network.
A small test suite for getting node information on a demonstration or pop-up mesh network.
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.
Have tests run on the nodes and only sent to the gatherer on request to get higher quality data.
Instead of initiating tests the server will serve simply as a gatherer. This will allow for a higher quality of data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.