From 957d9c4dccc53c63e83cb33f81218593489a8e7c Mon Sep 17 00:00:00 2001 From: Yoggzo Date: Wed, 30 Mar 2016 12:14:11 +0200 Subject: [PATCH] verif tests image --> OK --- server/Test/imageTests.php | 39 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/server/Test/imageTests.php b/server/Test/imageTests.php index 4adec08..a99fbd7 100644 --- a/server/Test/imageTests.php +++ b/server/Test/imageTests.php @@ -14,7 +14,7 @@ $opt['name'] = "Test"; $opt['tags'] = ['test', 'openstack']; //$opt['containerFormat'] = 'ami'; //$opt['diskFormat'] = 'iso'; -$opt['visibility'] = 'public'; +//$opt['visibility'] = 'public'; $opt['minDisk'] = 1; $opt['protected'] = false; $opt['minRam'] = 10; @@ -25,30 +25,39 @@ $retCreate = json_decode($App->show(), true)["Images"]; $idNew = $retCreate['id']; */ -/* -// Delete Image -$App->setPostParam('id', $idNew); -$image->action("deleteImage"); -*/ + + // Liste images $image->action("listImage"); $im = $App->show(); $images = json_decode($im, true)["Images"]; -echo "List images :
"; +$res; +echo "List images :

"; foreach($images as $i){ - echo $i['name']."
"; // Nom + $name = $i['name']; + if(strcmp($name,"Test") == 0) + { + $res = $i['id']; + } + echo $name."
"; // Nom echo $i['status']."
"; // Status $id = $i['id']; // Id echo $id."
"; - foreach ($i['tags'] as $tag) { // Tags + /*foreach ($i['tags'] as $tag) { // Tags echo $tag."
"; - } + }*/ echo "
"; } +// Delete Image + /* +$App->setPostParam('id', $res); +$image->action("deleteImage"); +*/ +/* // Details images echo "Détail image :
"; $App->setPostParam('id', $id); @@ -56,7 +65,7 @@ $image->action("detailsImage"); $retDetails = json_decode($App->show(), true)["Images"]; echo $retDetails['id']."
"; echo "
"; - +*/ /* // Download image @@ -66,18 +75,20 @@ $image->action("downloadImage"); // Desactivate Images +/* echo "Desactivate image :
"; echo $id."
"; $App->setPostParam('id', $id); $err = $image->action("desactivateImage"); echo "
"; +*/ +// Reactivate Images /* -// Resactivate Images echo $id."
"; -$App->setPostParam('id', $id); -$err = $image->action("resactivateImage"); +$App->setPostParam('id', $res); +$image->action("reactivateImage"); */