blob: c0fea7e9e656645b83de7c1f57d4da663c4a606d [file] [log] [blame]
Scott Bakerab23fa92013-08-25 16:53:49 -07001"""
2 Basic Sliver Test
3
4 1) Create a slice1
5 2) Create sliver1 on slice1
6"""
7
8import os
9import json
10import sys
11import time
12
Scott Baker166f4b82015-02-09 11:18:46 -080013sys.path.append("/opt/xos")
Scott Bakerab23fa92013-08-25 16:53:49 -070014
15os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
16from openstack.manager import OpenStackManager
17from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
18
19from planetstacktest import PlanetStackTest, fail_unless
20
21class SliverTest(PlanetStackTest):
22 def __init__(self):
23 PlanetStackTest.__init__(self)
24
25 def run_sliver1(self):
26 slice1Name = self.make_slice_name()
27 slice1 = Slice(name = slice1Name,
28 omf_friendly=True,
29 site=self.testSite,
30 creator=self.testUser)
31 slice1=self.save_and_wait_for_enacted(slice1, nonempty_fields=["tenant_id"])
32
33 sliver1 = Sliver(image = self.testImage,
34 creator=self.testUser,
35 slice=slice1,
36 node=self.testNode,
37 deploymentNetwork=self.testDeployment)
38 sliver1=self.save_and_wait_for_enacted(sliver1, nonempty_fields=["instance_id", "ip"])
39
40 def run(self):
41 self.setup()
42 try:
43 self.run_sliver1()
44 finally:
45 self.cleanup()
46
47def main():
48 SliverTest().run()
49
50if __name__=="__main__":
51 main()