summaryrefslogtreecommitdiff
path: root/server/Test/automatingTests.php
diff options
context:
space:
mode:
authorYoggzo <yogg@epsina.com>2016-04-19 23:57:03 +0200
committerYoggzo <yogg@epsina.com>2016-04-19 23:57:03 +0200
commit94629aeaf523f391f09ef18c1b2ca639e0b02d08 (patch)
tree727920b8dba502ce729b9bc059b0235d37bce76b /server/Test/automatingTests.php
parent438b9b4dcdee7e0c18c3477bb9592ac7efbebfec (diff)
tentative ip publique
Diffstat (limited to 'server/Test/automatingTests.php')
-rwxr-xr-xserver/Test/automatingTests.php65
1 files changed, 61 insertions, 4 deletions
diff --git a/server/Test/automatingTests.php b/server/Test/automatingTests.php
index 8715464..078f86b 100755
--- a/server/Test/automatingTests.php
+++ b/server/Test/automatingTests.php
@@ -2,27 +2,84 @@
include('InitTest.php');
include_once("../core/Image.php");
include_once("../core/Compute.php");
-//include_once("../core/Network.php");
+include_once("../core/Network.php");
//include_once("../core/Automating.php");
include_once("../core/FloatingIp.php");
$image = new Image($App);
$compute = new Compute($App);
-//$network = new Network($App);
+$network = new Network($App);
$floatingIp = new FloatingIp($App);
//$automating = new Automating($App);
// Liste des serveurs
+echo "Liste des serveurs : </br>";
$compute->action("listServers");
$servers = json_decode($App->show(), true)["Servers"];
+$id = null;
foreach($servers as $server){
- echo $server['name']." ".$server['id']."<br>";
+ echo $server['name']." ".$server['id']." ".$server['ipv4']."<br>";
+ if(strcmp($server['name'], "bob")){
+ $id = $server['id'];
+ }
}
+echo "</br>";
+
+/*
+// Liste des ports
+echo "Liste des ports : </br>";
+$network->action("listPorts");
+$ports = json_decode($App->show(), true)["Network"];
+foreach ($ports as $p) {
+ echo $p["fixedIps"]."</br>";
+}
+*/
+
+
+// liste des floatingip
+echo "Liste des floatingip : </br>";
+$floatingIp->action("listFloatingIp");
+$listFloatingIp = json_decode($App->show(), true)["FloatingIp"];
+$ip = null;
+foreach ($listFloatingIp as $floatIp){
+ echo $floatIp['floatingIpAddress']." ".$floatIp['id']." ".$floatIp["status"]."<br>";
+ $ip = $floatIp;
+}
+
+echo "</br>";
+
+// Création d'une ip flotante
+$opt = array();
+$opt['floatingNetworkId'] = $id;
+$opt['floatingip'] = $ip;
+//$opt['tenantId'] = "fbf5f920a7954b61b352bc09ce5ae803 ";
+//$opt['fixedIpAddress'] = "10.0.0.52";
+//$opt['floatingIpAddress'] = "148.60.11.116";
+//$opt['portId'] = "10.0.0.52";
+
+$App->setPostParam('opt', $opt);
+$floatingIp->action("createFloatingIp");
+$float = json_decode($App->show(), true)["FloatingIp"];
+if(!isset($float)){
+ echo "Erreur pendant la création</br>";
+}
+else{
+ foreach ($float as $f) {
+ echo $f." ";
+ }
+ echo "<br>";
+}
+
+
+echo "</br>";
// liste des floatingip
+echo "Liste des floatingip : </br>";
$floatingIp->action("listFloatingIp");
$listFloatingIp = json_decode($App->show(), true)["FloatingIp"];
foreach ($listFloatingIp as $floatIp){
- echo "IP : ".$floatIp['floating_ip_address']." et ID: ".$floatIp['id']." ".$floatIp["status"]."<br>";
+ echo $floatIp['floatingIpAddress']." ".$floatIp['id']." ".$floatIp["status"]."<br>";
}
+
+
?> \ No newline at end of file