Fixing wrong license
[nepi.git] / test / resources / planetlab / plcapi.py
1 #!/usr/bin/env python
2 #
3 #    NEPI, a framework to manage network experiments
4 #    Copyright (C) 2013 INRIA
5 #
6 #    This program is free software: you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License version 2 as
8 #    published by the Free Software Foundation;
9 #
10 #    This program is distributed in the hope that it will be useful,
11 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #    GNU General Public License for more details.
14 #
15 #    You should have received a copy of the GNU General Public License
16 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 #
18 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
19
20
21 from nepi.resources.planetlab.plcapi import PLCAPIFactory
22
23 import os
24 import unittest
25
26 class PlanetlabAPITestCase(unittest.TestCase):
27     def setUp(self):
28         self.slicename = 'inria_nepi'
29         self.host1 = 'nepi2.pl.sophia.inria.fr'
30         self.host2 = 'nepi5.pl.sophia.inria.fr'
31
32     def test_list_hosts(self):
33         slicename = os.environ.get('PL_USER')
34         pl_pass = os.environ.get('PL_PASS')
35         pl_url = "nepiplc.pl.sophia.inria.fr"
36
37         plapi =  PLCAPIFactory.get_api(slicename, pl_pass, pl_url)
38
39         plapi.test()
40
41         nodes = plapi.get_nodes()
42         self.assertTrue(len(nodes)>0)
43
44
45 if __name__ == '__main__':
46     unittest.main()
47