CHips L MINI SHELL

CHips L pro

Current Path : /proc/2/root/usr/local/rvglobalsoft/rvglobalsoft/auto/Tests/
Upload File :
Current File : //proc/2/root/usr/local/rvglobalsoft/rvglobalsoft/auto/Tests/CommonLibTest.ndb.pl

use PerlUnit::TestCase;

use File::Basename;
use Cwd 'abs_path';
my $thispath = dirname(abs_path(__FILE__));

eval{
	use RVSInstaller::CommonLib;
	my ($path) = dirname($thispath);
	#print $path . '/rvsitebuilderinstaller/RVSInstaller/CommonLib.pm';
    #require '/home/parinya/public_html/workspace/rvsitebuilderinstaller/rvsitebuilderinstaller/RVSInstaller/CommonLib.pm';
};

sub set_up {
}

sub tear_down {

}

sub test_CommonLib_isLocalhost
{
    testcase ('test_RVSInstaller_CommonLib_isLocalhost', sub {    
        assertTrue(RVSInstaller::CommonLib::isLocalhost('127.0.0.1'), '127.0.0.1 is true');
        assertTrue(RVSInstaller::CommonLib::isLocalhost('localhost'), 'localhost is true');
    });
}

sub test_getrealipbyhostname
{
	testcase ('test_RVSInstaller_CommonLib_isLocalhost', sub {
		assertEquals('50.23.149.130', RVSInstaller::CommonLib::getrealipbyhostname('50.23.149.130'), '50.23.149.130 is real ip');
		assertEquals('50.23.149.130', RVSInstaller::CommonLib::getrealipbyhostname('license2.rvglobalsoft.com'), 'license2.rvglobalsoft.com real ip is 50.23.149.130');
		assertEquals('rvlicense2.rvglobalsoft.com', RVSInstaller::CommonLib::getrealipbyhostname('rvlicense2.rvglobalsoft.com'), 'rvlicense2.rvglobalsoft.com not have ip, it return host');
	});
}

1;

Copyright 2K16 - 2K18 Indonesian Hacker Rulez