added test for lamdaemon protocol version

This commit is contained in:
Roland Gruber 2010-11-16 18:38:48 +00:00
parent d32f1fb55e
commit 8c6aa943dc
2 changed files with 22 additions and 1 deletions

View File

@ -25,6 +25,10 @@
use Sys::Syslog; use Sys::Syslog;
# Defines the protocol version of the lamdaemon script.
# This will only be changed when additional commands are added etc.
my $LAMDAEMON_PROTOCOL_VERSION = 1;
my $SPLIT_DELIMITER = "###x##y##x###"; my $SPLIT_DELIMITER = "###x##y##x###";
# set a known path # set a known path
@ -134,8 +138,17 @@ print "$return\n";
# Runs tests to check the environment # Runs tests to check the environment
# #
sub runTest { sub runTest {
# protocol version check
if ($vals[2] eq 'version') {
if ($vals[3] eq $LAMDAEMON_PROTOCOL_VERSION) {
$return = "INFO,Version check ok";
}
else {
$return = "ERROR,Version check failed. Please upgrade the lamdaemon script to the same version as your main LAM installation.";
}
}
# basic test # basic test
if ($vals[2] eq 'basic') { elsif ($vals[2] eq 'basic') {
$return = "INFO,Basic test ok"; $return = "INFO,Basic test ok";
} }
# quota test # quota test
@ -165,6 +178,9 @@ sub runTest {
} }
} }
} }
else {
$return = "ERROR,Unknown test: $vals[2]";
}
} }
# #

View File

@ -169,6 +169,7 @@ function lamTestLamdaemon($command, $stopTest, $handle, $testText, $container) {
*/ */
function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota, $container) { function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota, $container) {
$SPLIT_DELIMITER = "###x##y##x###"; $SPLIT_DELIMITER = "###x##y##x###";
$LAMDAEMON_PROTOCOL_VERSION = '1';
$okImage = "../../graphics/pass.png"; $okImage = "../../graphics/pass.png";
$failImage = "../../graphics/fail.png"; $failImage = "../../graphics/fail.png";
@ -260,6 +261,10 @@ function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota, $contai
$stopTest = lamTestLamdaemon("+" . $SPLIT_DELIMITER . "test" . $SPLIT_DELIMITER . "basic", $stopTest, $handle, _("Execute lamdaemon"), $container); $stopTest = lamTestLamdaemon("+" . $SPLIT_DELIMITER . "test" . $SPLIT_DELIMITER . "basic", $stopTest, $handle, _("Execute lamdaemon"), $container);
} }
if (!$stopTest) {
$stopTest = lamTestLamdaemon("+" . $SPLIT_DELIMITER . "test" . $SPLIT_DELIMITER . "version" . $SPLIT_DELIMITER . $LAMDAEMON_PROTOCOL_VERSION, $stopTest, $handle, _("Lamdaemon version"), $container);
}
if (!$stopTest) { if (!$stopTest) {
$handle = lamTestConnectSSH($serverName); $handle = lamTestConnectSSH($serverName);
@$handle->login($userName, $credentials[1]); @$handle->login($userName, $credentials[1]);