verif tests image --> OK

This commit is contained in:
Yoggzo 2016-03-30 12:14:11 +02:00
parent ba8b5feb07
commit 957d9c4dcc

View file

@ -14,7 +14,7 @@ $opt['name'] = "Test";
$opt['tags'] = ['test', 'openstack']; $opt['tags'] = ['test', 'openstack'];
//$opt['containerFormat'] = 'ami'; //$opt['containerFormat'] = 'ami';
//$opt['diskFormat'] = 'iso'; //$opt['diskFormat'] = 'iso';
$opt['visibility'] = 'public'; //$opt['visibility'] = 'public';
$opt['minDisk'] = 1; $opt['minDisk'] = 1;
$opt['protected'] = false; $opt['protected'] = false;
$opt['minRam'] = 10; $opt['minRam'] = 10;
@ -25,30 +25,39 @@ $retCreate = json_decode($App->show(), true)["Images"];
$idNew = $retCreate['id']; $idNew = $retCreate['id'];
*/ */
/*
// Delete Image
$App->setPostParam('id', $idNew);
$image->action("deleteImage");
*/
// Liste images // Liste images
$image->action("listImage"); $image->action("listImage");
$im = $App->show(); $im = $App->show();
$images = json_decode($im, true)["Images"]; $images = json_decode($im, true)["Images"];
echo "List images :</br>"; $res;
echo "List images :</br></br>";
foreach($images as $i){ foreach($images as $i){
echo $i['name']."</br>"; // Nom $name = $i['name'];
if(strcmp($name,"Test") == 0)
{
$res = $i['id'];
}
echo $name."</br>"; // Nom
echo $i['status']."</br>"; // Status echo $i['status']."</br>"; // Status
$id = $i['id']; // Id $id = $i['id']; // Id
echo $id."</br>"; echo $id."</br>";
foreach ($i['tags'] as $tag) { // Tags /*foreach ($i['tags'] as $tag) { // Tags
echo $tag."</br>"; echo $tag."</br>";
} }*/
echo "</br>"; echo "</br>";
} }
// Delete Image
/*
$App->setPostParam('id', $res);
$image->action("deleteImage");
*/
/*
// Details images // Details images
echo "Détail image :</br>"; echo "Détail image :</br>";
$App->setPostParam('id', $id); $App->setPostParam('id', $id);
@ -56,7 +65,7 @@ $image->action("detailsImage");
$retDetails = json_decode($App->show(), true)["Images"]; $retDetails = json_decode($App->show(), true)["Images"];
echo $retDetails['id']."</br>"; echo $retDetails['id']."</br>";
echo "</br>"; echo "</br>";
*/
/* /*
// Download image // Download image
@ -66,18 +75,20 @@ $image->action("downloadImage");
// Desactivate Images // Desactivate Images
/*
echo "Desactivate image : </br>"; echo "Desactivate image : </br>";
echo $id."</br>"; echo $id."</br>";
$App->setPostParam('id', $id); $App->setPostParam('id', $id);
$err = $image->action("desactivateImage"); $err = $image->action("desactivateImage");
echo "</br>"; echo "</br>";
*/
// Reactivate Images
/* /*
// Resactivate Images
echo $id."</br>"; echo $id."</br>";
$App->setPostParam('id', $id); $App->setPostParam('id', $res);
$err = $image->action("resactivateImage"); $image->action("reactivateImage");
*/ */