27 require_once
'./utility.php';
58 $this->testDb =
new TestPgDb(
'ununpackExceptional');
59 $this->agentDir = dirname(dirname(__DIR__)).
"/";
61 $sysConf = $this->testDb->getFossSysConf();
63 $this->testInstaller->init();
64 $this->testInstaller->install($this->agentDir);
66 $this->testDb->createSequences(array(),
true);
67 $this->testDb->createPlainTables(array(),
true);
68 $this->testDb->createInheritedTables(array());
69 $this->testDb->alterTables(array(),
true);
78 $this->testInstaller->uninstall($this->agentDir);
79 $this->testInstaller->clear();
80 $this->testInstaller->rmRepo();
93 global $TEST_DATA_PATH;
94 global $TEST_RESULT_PATH;
95 $fossology_testconfig = $this->testDb->getFossSysConf();
97 $UNUNPACK_CMD = $this->agentDir .
"/agent/ununpack";
98 if (!empty($TEST_RESULT_PATH))
99 exec(
"/bin/rm -rf $TEST_RESULT_PATH");
100 $command =
"$UNUNPACK_CMD -qCRs $TEST_DATA_PATH/test.iso -d $TEST_RESULT_PATH -c $fossology_testconfig > /dev/null 2>&1";
101 $last = exec($command, $usageOut, $rtn);
102 $this->assertNotEquals($rtn, 0);
103 $this->assertFileNotExists(
"$TEST_RESULT_PATH/test.iso.dir/test1.zip.tar.dir/test1.zip");
113 global $TEST_DATA_PATH;
114 global $TEST_RESULT_PATH;
115 $fossology_testconfig = $this->testDb->getFossSysConf();
117 $UNUNPACK_CMD = $this->agentDir .
"/agent/ununpack";
118 if (!empty($TEST_RESULT_PATH))
119 exec(
"/bin/rm -rf $TEST_RESULT_PATH");
120 $command =
"$UNUNPACK_CMD -qCR $TEST_DATA_PATH/null_file -d $TEST_RESULT_PATH -c $fossology_testconfig > /dev/null 2>&1";
121 $last = exec($command, $usageOut, $rtn);
122 $this->assertNotEquals($rtn, 0);
123 $this->assertFileNotExists(
"$TEST_RESULT_PATH/null_file.dir/");
testNullFile()
Passing null file to agent.
Test the ununpack agent cli parameters. (Exceptions)
testValidParam()
Pass an invalid flag to agent which should not run.
setUp()
Setup test repo and db.
tearDown()
Teardown test repo and db.