How to run TET framework

From NetBSD Wiki

Jump to: navigation, search

Contents

What TET is

The TETware family of tools are Test Execution Management Systems that takes care of the administration, sequencing, reporting and portability of all of the tests that you develop. Freeing up developers to concentrate on test development and helping testers by providing them with a single, standard, test harness. Enabling you to deliver your software projects on time and across multiple operating systems. They are all available off-the-virtual-shelf. Easily accessed by ftp download. So stop re-inventing the wheel, take the drudge out of test development and use TETware.

Reason of this article

There is an artcile describes how to build and run TET framework from scratch. The pkgsrc version has several restrictions:

  • the recent version not available until now
  • necessary to have the pkgsrc infrastructure
  • only distributed version of TET is provided

However, you may apply patches from the pkgsrc tree (for example the patch-ad still can be applied for distributed TET).

Porting to NetBSD

Current opensourced version is 3.7a. To download or check new versions look to the Links section below. (The guide was tested at least on the NetBSD-current/i386 and NetBSD-current/ARMv6)

Patchset

The simply patch would be applied before compilation is started.

Prebuild

  • After applying patch you'll need to copy the proper makefile
cp src/defines/UNTESTED/freebsd.mk src/defines/netbsd.mk
  • Make the $TET_ROOT directory like /opt/tet3
  • Copy content of TET sources tree to $TET_ROOT

Notice to get distributed TET:

  • Create regular user tet on the target system with home path as $TET_ROOT without real shell

Build

  • Change working directory to $TET_ROOT
  • Build framework
./configure -t <style>
cd src
make
make install

where <style> means Lite (-t lite) or Distributed (-t inet) version of TET framework.

Notice to get distributed TET:

  • Change owner of the $TET_ROOT to tet recursively

Update user's files

  • Put to your ~/.profile
# TET
export TET_ROOT="/opt/tet3"
export PATH=$PATH:$TET_ROOT/bin

System files correction (distributed TET)

  • Start tccd daemon from the /etc/rc.conf
export TET_ROOT="/opt/tet3"
if test -x "$TET_ROOT/bin/tccd"
then
        $TET_ROOT/bin/tccd && echo "TET3 tccd started"
fi

Other files ($TET_ROOT/systems, $HOME/systems.equiv, /etc/services) are corrected in according to TET3 install guide.

Sample of required files

You'll need a minimal $TET_ROOT/systems file. The following content in the file is enough for this test suite.

000 localhost 60103

For the 'inet' version of TET, you'll need tccd running, and a $HOME/systems.equiv file in the directory of the user running tccd. The following contents will do for this file:

Note! In our case the $HOME is equivalent to /opt/tet3

localhost

And you'll need to append following lines to the /etc/services:

tcc             60103/tcp
tcc             60103/udp

Simple check

The directory contrib in the source tree contains a number of simplest examples of test cases. Let's start something from it step by step. Consider test cases under contrib/capi. Login as user tet. Be ensure you have set $TET_ROOT to actual path (/opt/tet3 in our case) and $TET_ROOT/bin is covered by $PATH.

$ echo $TET_ROOT
/opt/tet3
$ echo $PATH
/home/andy/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbin:/opt/tet3/bin

Change current directory to $TET_ROOT/contrib/capi.

cd $TET_ROOT/contrib/capi

Patch test case build system (yeah, I know...):

--- tools/buildtool.c.orig      2008-11-24 13:15:58.000000000 +0000
+++ tools/buildtool.c   2008-11-24 13:16:15.000000000 +0000
@@ -51,7 +51,7 @@
 #define BUILDSUCCESS 0   /* successful return from buildtool */


-static void tbuild()
+void tbuild()
 {
 char command_line[BUFLEN];
 char bres_line[BUFSIZ];

To run the test suite, firstly apply profile setting, then run the Setup script and after use tcc.

source profile
sh ./Setup
tcc -p -bec contrib/capi

Links

Personal tools