Commit 08e7022b authored by Reto Da Forno's avatar Reto Da Forno
Browse files

minor bugfix, logo added, database schema updated

parent 58bef726
......@@ -447,7 +447,6 @@ CREATE TABLE `tbl_serv_users` (
`login_count` int(11) NOT NULL DEFAULT '0',
`disable_infomails` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'If set to 1, the user will not get emails which just inform about the status of a test. Emails with warnings/errors will still be sent though.',
`last_changed` datetime DEFAULT NULL,
`use_daq` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`serv_users_key`)
) ENGINE=InnoDB AUTO_INCREMENT=370 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
......
......@@ -5,6 +5,10 @@
USER="flocklab"
HOST="flocklab-dev-server"
if [ $# -gt 0 ]; then
HOST=$1
fi
echo "Going to update files on FlockLab server $HOST..."
sleep 2 # give the user time to abort, just in case
......
......@@ -190,12 +190,14 @@ input[type=submit], input[type=button], input[type=reset] {
height: 24px;
padding-left: 7px;
padding-right: 7px;
cursor: pointer;
}
input[type=file] {
height: 24px;
width: 350px;
margin-left: 4px;
cursor: pointer;
}
input[disabled="disabled"], input.disabled {
......@@ -291,7 +293,7 @@ p.warning {
*.info {
height: auto;
min-height: 50px;
border: solid 2px gray;
border: solid 0px #DDD;
padding: 2px;
background-image: url(../pics/bg_info.png);
background-repeat: repeat-x;
......@@ -490,3 +492,7 @@ div.content table.recaptchatable {
.bold {
font-weight: bold
}
form td:hover {
background-color: #FFFFFF;
}
......@@ -345,41 +345,40 @@ function validate_image($image, &$errors) {
global $CONFIG;
$validate_image_errors = array();
foreach(Array('name','platform') as $field)
if (!isset($image[$field]) || strlen($image[$field])==0)
if (!isset($image[$field]) || strlen($image[$field])==0) {
array_push($validate_image_errors, "Missing mandatory field <i>".$field."</i>");
}
// Get the file and check if it is a valid image
$imagefile = tempnam(sys_get_temp_dir(), 'flocklab');
file_put_contents($imagefile, $image['data']);
$platform_list = get_available_platforms();
// copy image file to testmanagement server if on a different host
$islocalhost = $CONFIG['testmanagementserver']['host'] == "localhost" || CONFIG['testmanagementserver']['host'] == "";
if ($islocalhost) {
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'mkdir ".$CONFIG['testmanagementserver']['tempdir']."'";
exec($cmd);
$cmd = "scp ".$imagefile." ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host'].":".$CONFIG['testmanagementserver']['tempdir'];
exec($cmd, $output, $ret);
if ($ret) {
array_push($errors, "Failed to copy file '$test_config_file' to testmanagement server.");
return 1;
}
// remove unused file and adjust imagefile path
unlink($imagefile);
$imagefile = $CONFIG['testmanagementserver']['tempdir']."/".basename($imagefile);
// copy image file to testmanagement server
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'mkdir ".$CONFIG['testmanagementserver']['tempdir']."'";
exec($cmd);
$cmd = "scp ".$imagefile." ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host'].":".$CONFIG['testmanagementserver']['tempdir'];
exec($cmd, $output, $ret);
if ($ret) {
array_push($errors, "Failed to copy file '$test_config_file' to testmanagement server.");
return False;
}
// remove unused file and adjust imagefile path
unlink($imagefile);
$imagefile = $CONFIG['testmanagementserver']['tempdir']."/".basename($imagefile);
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." '".$CONFIG['testmanagementserver']['venvwrapper']." ".$CONFIG['targetimage']['imagevalidator']." --image=".$imagefile." --platform=". $platform_list[$image['platform']][0]['name']." --core=".$image['core']."' 2>&1";
exec($cmd , $output, $ret);
// remove file
if ($islocalhost) {
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'rm ".$imagefile."'";
exec($cmd);
} else {
unlink($imagefile);
}
if ($ret != 0) {
array_push($validate_image_errors, "The supplied file is not a valid image for this platform.");
}
// remove file
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'rm ".$imagefile."'";
exec($cmd, $output, $ret);
if ($ret) {
foreach ($output as $error) {
array_push($errors, $error);
}
}
$errors = array_merge($errors, $validate_image_errors);
return count($validate_image_errors)==0;
return count($errors) == 0;
}
/*
......@@ -455,20 +454,17 @@ function store_image($image) {
// validate test
function validate_test($test_config_file, &$errors) {
global $CONFIG;
// copy xml file to testmanagement server if it is a different host
$islocalhost = $CONFIG['testmanagementserver']['host'] == "localhost" || CONFIG['testmanagementserver']['host'] == "";
if ($islocalhost) {
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'mkdir ".$CONFIG['testmanagementserver']['tempdir']."'";
exec($cmd);
$cmd = "scp ".$test_config_file." ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host'].":".$CONFIG['testmanagementserver']['tempdir'];
exec($cmd , $output, $ret);
if ($ret) {
array_push($errors, "Failed to copy file '$test_config_file' to testmanagement server.");
return 1;
}
// adjust file name to new path
$test_config_file = $CONFIG['testmanagementserver']['tempdir']."/".basename($test_config_file);
// copy xml file to testmanagement server
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'mkdir ".$CONFIG['testmanagementserver']['tempdir']."'";
exec($cmd);
$cmd = "scp ".$test_config_file." ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host'].":".$CONFIG['testmanagementserver']['tempdir'];
exec($cmd , $output, $ret);
if ($ret) {
array_push($errors, "Failed to copy file '$test_config_file' to testmanagement server.");
return False;
}
// adjust file name to new path
$test_config_file = $CONFIG['testmanagementserver']['tempdir']."/".basename($test_config_file);
// execute XML validation script in the python virtual environment on the testmanagement server as user flocklab
$cmd = $CONFIG['testmanagementserver']['venvwrapper']." ".$CONFIG['dispatcher']['validationscript']." -x ".$test_config_file." -s ".$CONFIG['xml']['schemapath']." -u " . $_SESSION['serv_users_key'];
exec("ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." '".$cmd."' 2>&1", $output, $ret);
......@@ -478,11 +474,14 @@ function validate_test($test_config_file, &$errors) {
}
}
// remove copied file
if ($islocalhost) {
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'rm ".$test_config_file."'";
exec($cmd);
$cmd = "ssh ".$CONFIG['testmanagementserver']['user']."@".$CONFIG['testmanagementserver']['host']." 'rm ".$test_config_file."'";
exec($cmd, $output, $ret);
if ($ret) {
foreach ($output as $error) {
array_push($errors, $error);
}
}
return $ret == 0;
return count($errors) == 0;
}
......
webserver/pics/icons/favicon.ico

4.19 KB | W: | H:

webserver/pics/icons/favicon.ico

58.2 KB | W: | H:

webserver/pics/icons/favicon.ico
webserver/pics/icons/favicon.ico
webserver/pics/icons/favicon.ico
webserver/pics/icons/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment