# Testing a FreeBSD port



## jack63ss (Aug 28, 2009)

Is there a standard test suite that can be used to validate a FreeBSD port to an embedded system ? I am primarily concerned about the kernel, but I do use some user space apps as well.
Thanks


----------



## CodeBlock (Aug 28, 2009)

Not sure what you mean by testing a port. You could set up a tinderbox to test ports in a jailed environment. Or take a look at http://www.freebsd.org/doc/en/books/porters-handbook/porting-testing.html  and maybe http://www.freebsd.org/doc/en/books/porters-handbook/porting-portlint.html


----------



## jack63ss (Aug 30, 2009)

By "testing the port" I meant a suite of tests that I can compile on my platform and execute to make sure all thge basic functions are working properly. For example, the Linux Test Project provides a set of tests to evaluate most Linux distributions. I was wondering if these was something similar for BSD ?


----------



## SirDice (Aug 30, 2009)

Not sure if it's what you're looking for but have a look in /usr/src/tools/regression/.


----------



## CodeBlock (Aug 31, 2009)

jack63ss said:
			
		

> By "testing the port" I meant a suite of tests that I can compile on my platform and execute to make sure all thge basic functions are working properly. For example, the Linux Test Project provides a set of tests to evaluate most Linux distributions. I was wondering if these was something similar for BSD ?



Sound's like you're looking for ports-mgmt/portlint

http://www.freebsd.org/doc/en/books/porters-handbook/testing-portlint.html

This will check the syntax of the Makefile, as well as checking build, install, make package, and deinstall.


----------



## ckester (Sep 1, 2009)

As you probably know, a FreeBSD port consists of a Makefile, a pkg-descr file, a distinfo file, and perhaps a pkg-plist files and some patchfiles in a files subdirectory.  Portlint tests whether there are any syntax or semantics problems in those port files.  It does NOT verify that the port will actually build or install correctly.

Many port maintainers use tinderbox to verify that their ports build, install and deinstall correctly -- and that all prerequisites are correctly specified.  But here again, the only thing being tested is the build and install process, NOT the correct behavior of the applications or libraries so installed.

It's probably not possible to write a generic test program that is appropriate for all possible ports, because they all do different things.  Test engineering is not a trivial task!  

If  the author of the software didn't provide a test suite, you're probably going to have to content yourself with some simple "smoke tests":

- Can you start up the application without it crashing?
- Do the most common and obvious features work as expected?
- If the application has a help system, does it work as expected?
- Etc.

How much of this kind of "poking around" you do is entirely up to you.  But for most ports -- especially those that are known to work on other platforms -- passing simple smoke tests like these is usually enough to give you some confidence that it's at least as bug-free on FreeBSD as it is on those other platforms.


----------



## ckester (Sep 1, 2009)

I just re-read your posts, and what I had to say might have missed the point.

It sounds like, when you say "port", you mean moving the FreeBSD kernel and userland to some  previously unsupported hardware.   If so, you might want to check with kernel developers.  I'm sure they do have some sort of test suite that they might share with you.

In the FreeBSD world, "ports" refers to third-party software, i.e., stuff that's not part of FreeBSD itself.


----------



## CodeBlock (Sep 1, 2009)

Ah, wow you are correct, I was thinking of ports-mgmt/porttools, not ports-mgmt/portlint.. Sorry about that.


----------

