24 require_once(dirname(dirname(__FILE__)) .
'/common-container.php');
25 require_once(dirname(dirname(__FILE__)) .
'/common-db.php');
26 require_once(dirname(dirname(__FILE__)) .
'/common-sysconfig.php');
34 public $DB_COMMAND =
"";
36 public $sys_conf =
"";
43 if (!is_callable(
'pg_connect')) {
44 $this->markTestSkipped(
"php-psql not found");
50 $DB_COMMAND = dirname(dirname(dirname(dirname(__FILE__)))).
"/testing/db/createTestDB.php";
51 exec($DB_COMMAND, $dbout, $rc);
52 $sys_conf = $dbout[0];
67 $this->assertEquals(
"FOSSology Support", $SysConf[
'SYSCONFIG'][
'SupportEmailSubject']);
68 $hostname = exec(
"hostname -f");
69 if (empty($hostname)) {
70 $hostname =
"localhost";
72 $FOSSologyURL = $hostname.
"/repo/";
73 $this->assertEquals($FOSSologyURL, $SysConf[
'SYSCONFIG'][
'FOSSologyURL']);
82 if (!is_callable(
'pg_connect')) {
90 exec(
"$DB_COMMAND -d $DB_NAME");
98 foreach (array(
''=>
false,
'1.2.3.4'=>
true,
'1.7.49.343'=>
false,
'255.249.199.0'=>
true) as $ip=>$correct) {
99 $this->assertEquals(
check_IP($ip),$correct,$message=
"result for IP $ip is false");
DBconnect($sysconfdir, $options="", $exitOnFail=true)
Connect to database engine. This is a no-op if $PG_CONN already has a value.
testConfigInit()
test for ConfigInit() after ConfigInit() is executed, we can get some sysconfig information, include: SupportEmailLabel, SupportEmailAddr, SupportEmailSubject, BannerMsg, LogoImage, LogoLink, FOSSologyURL
tearDownDb()
clean the env db
test_check_IP()
clean the env
setUpDb()
initialization with db
ConfigInit($sysconfdir, &$SysConf)
Initialize the fossology system after bootstrap().
check_IP($ip)
Check if the ip address is valid.