29 protected function setUp() : void
33 $this->testdir = dirname(dirname(__DIR__)).
"/agent_tests/testdata/NomosTestfiles/";
47 $sysConf = $this->testDb->getFossSysConf();
48 $nomos = $this->agentDir .
"/agent/nomos";
50 exec(
"find $this->testdir -type f -not \( -wholename \"*svn*\" \) -exec $nomos -c $sysConf -l '{}' + > scan.out", $out, $rtn);
52 $file_correct = dirname(dirname(__FILE__)).
"/testdata/LastGoodNomosTestfilesScan";
53 $last = exec(
"wc -l < $file_correct");
54 $regtest_msg =
"Right now, we have $last nomos regression tests\n";
56 $regtest_cmd =
"echo '$regtest_msg' >./nomos-regression-test.html";
58 $old = str_replace(
'/',
'\/',dirname(dirname(__FILE__)).
"/testdata/");
59 exec(
"sed 's/ $old/ /g' ./scan.out > ./scan.out.r");
60 exec(
"sort $file_correct >./LastGoodNomosTestfilesScan.s");
61 exec(
"sort ./scan.out.r >./scan.out.s");
62 exec(
"diff ./LastGoodNomosTestfilesScan.s ./scan.out.s >./report.d", $out, $rtn);
63 $count = exec(
"cat report.d|wc -l", $out, $ret);
65 print
"Some lines of licenses are different, see details below, or view ./report.d\n";
66 exec(
"cat ./report.d", $report);
67 foreach ($report as $line) print
"$line\n";
69 $this->assertEquals($count,
'0');
Tests for common CLI operations.
Runs regression test on NOMOS.
testDiffNomos()
Runs regression test on NOMOS based on LastGoodNomosTestfilesScan.
setUp()
Setup the test cases and initialize the objects.