[rrd-developers] Assistance required, a simple test suite.

D.Walsh info at daleenterprise.com
Tue Feb 14 11:12:11 MET 2006


Can someone help me out here please.

Because of PHP's PECL submission policy, I've been forced to rewrite  
the rrdtool extension again to utilize the new API and I'm just about  
done.

What I need is some PHP scripts to test rrdtool functionality.

These tests should be basic and simple to allow compatibility for all  
version of RRDTool because I have no clue what version the end user  
will be using.

Yes, I do take into account additional features and functionality in  
newer versions of RRDTool but again, I'm trying to test functionality  
in different OS's under different versions of RRDTool.

The functions that need testing.

create
graph
update
fetch
last


Here is an example of the graph function that has already been tested.

________________________________

if (file_exists("/usr/local/rrdtool/bin/rrdtool")) {
	$rrdtool = "/usr/local/rrdtool/bin/rrdtool";
} elseif (file_exists("/usr/local/bin/rrdtool")) {
	$rrdtool = "/usr/local/bin/rrdtool";
} elseif (file_exists("/usr/bin/rrdtool")) {
	$rrdtool = "/usr/bin/rrdtool";
}


if (!function_exists('rrd_graph') && !@dl('rrdtool.so')) {

	function rrd_graph ($img, $opts, $count)  {
		global $rrd_error_val, $rrdtool;

		unset($output);
		$rrd_error_val = NULL;

		$cmd = "$rrdtool graph $img '". implode("' \\\n'",$opts) . "'" . "  
2>&1";
		$out = exec($cmd, $output, $rrd_error_val);

		if ($rrd_error_val) {
			if (!is_numeric($rrd_error_val)) {
				$rrd_error_val = $output[0];
			}
			return false;
		}
		return $output;
}

________________________________


-- Dale

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-developers mailing list