16 require_once(dirname(dirname(__FILE__)) .
'/common-container.php');
17 require_once(dirname(dirname(__FILE__)) .
'/common-db.php');
24 public $sys_conf =
"";
42 if (!is_callable(
'pg_connect')) {
43 $this->markTestSkipped(
"php-psql not found");
47 $this->testDb =
new TestPgDb(
"sysconfTest");
48 $sys_conf = $this->testDb->getFossSysConf();
49 $this->testDb->getDbManager()->getDriver();
51 $this->testDb->createPlainTables([
'sysconfig'],
false);
52 $this->testDb->createSequences([
'sysconfig_sysconfig_pk_seq'],
false);
53 $this->testDb->alterTables([
'sysconfig'],
false);
57 $this->testInstaller->init();
71 $this->assertEquals(
"FOSSology Support", $SysConf[
'SYSCONFIG'][
'SupportEmailSubject']);
72 $hostname = exec(
"hostname -f");
73 if (empty($hostname)) {
74 $hostname =
"localhost";
76 $FOSSologyURL = $hostname.
"/repo/";
77 $this->assertEquals($FOSSologyURL, $SysConf[
'SYSCONFIG'][
'FOSSologyURL']);
86 if (!is_callable(
'pg_connect')) {
90 $this->testInstaller->clear();
91 $this->testDb->fullDestruct();
100 foreach (array(
''=>
false,
'1.2.3.4'=>
true,
'1.7.49.343'=>
false,
'255.249.199.0'=>
true) as $ip=>$correct) {
101 $this->assertEquals(
check_IP($ip),$correct,
"result for IP $ip is false");
tearDownDb()
clean the env
test_check_IP()
clean the env
testConfigInit()
test for ConfigInit() after ConfigInit() is executed, we can get some sysconfig information,...
setUpDb()
initialization with db
Populate_sysconfig()
Populate the sysconfig table with core variables.
check_IP($ip)
Check if the ip address is valid.
ConfigInit($sysconfdir, &$SysConf, $exitOnDbFail=true)
Initialize the fossology system after bootstrap().