面向嵌入式系统开发人员的回归测试脚本框架
monk_tf的Python项目详细描述
简介
使用monk可以像编写单元测试一样编写测试,只要它们 能够与嵌入式系统交互。
让我们看一个例子。在下面的例子中,我们有一个嵌入式系统 带有串行终端和网络接口。我们想写一个测试 检查网络接口是否通过DHCP接收正确的信息。
用notests编写的测试用例:
importnose.toolsasntimportmonk_tf.connasmcimportmonk_tf.devasmddeftest_dhcp():""" check whether dhcp is implemented correctly """# setupdevice=md.Device(mc.SerialConn('/dev/ttyUSB1','root','sosecure'))# exercisedevice.cmd('dhcpc -i eth0')# verifyifconfig_out=device.cmd('ifconfig eth0')nt.ok_('192.168.2.100'inifconfig_out)
即使对于非python程序员,也不难猜测,这个测试 将连接到/dev/ttyUSB1上的串行接口,发送shell命令 dhcpc为eth0接口获取新的IP地址,最后 检查是否接收到测试仪预期的IP地址。不需要 担心连接处理、登录和会话处理。
有关详细信息,请参见 API Docs。
版本0.1.10/0.1.11(2014-05-05)
使设备能够使用当前连接查找其IP地址。例子 用例:你有一个串行连接到你的设备,你知道如何 进入。设备本身使用DHCP获取IP地址,并且您要发送 对它的http请求。现在您可以使用monk通过 然后发送您的http请求。
版本0.1.9(2014-04-14)
- add option to set debug fixture file which overwrites differences between test environment and development environment while developing
版本0.1.7/0.1.8(2014-03-27)
- workaround for slower password prompt return times
- there was a problem in the publishing process which lead to changes not being added to the 0.1.7 release
版本0.1.6(2014-03-06)
- again bugs got fixed
- most important topic was stabilizing the connect->login->cmd process
- error handling improved with more ifs and more userfriendly exceptions
- it is now possible to completely move from Disconnected to Authenticated even when the target device is just booting.
版本0.1.5(2014-02-25)
- fixed many bugs
- most notably 0.1.4 was actually not able to be installed from PyPI without workaround
版本0.1.4(2014-01-24)
- fixed some urgent bugs
- renamed harness to fixture
- updated docs
版本0.1.3
- complete reimplementation finished
- documentation not up to date yet
- Features are: * create independent connections with the connection layer * example implementation with SerialConnection * create complete device abstraction with the dev layer * basic device class in layer * separate test cases and connection data for reusage with harness layer * example parser for extendend INI implemented in harness layer
版本0.1.2
- added GPLv3+ (source) and CC-BY-SA 3.0 (docs) Licenses
- updated coding standards
版本0.1.1
- rewrote documentation
- style guide
- configured for pip, setuptools, virtualenv
- restarted unit test suite with nosetests
- added development and test requirements
释放0.1
最初的释放。