Skip to content

Commit

Permalink
Set up a slice name and use the name to tear it down
Browse files Browse the repository at this point in the history
  • Loading branch information
sajith committed Nov 8, 2023
1 parent 6d2ee44 commit 8eb4c4b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/integration/test_L2_with_mflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,19 @@

from mflib.mflib import MFLib

from fabrictestbed_extensions.fablib.fablib import FablibManager
from fabrictestbed_extensions.fablib.fablib import FablibManager, fablib


class L2MFLibTests(unittest.TestCase):

def setUp(self):
time_stamp = time.strftime("%Y-%m-%d %H:%M:%S")
host = socket.gethostname()
self.slice_name = f"integration test @ {time_stamp} on {host}"

def tearDown(self):
fablib.get_slice(self.slice_name).delete()

def test_add_l2_measurement_nodes(self):
"""
Add measurement nodes to L2 network.
Expand All @@ -45,10 +54,6 @@ def test_add_l2_measurement_nodes(self):

self.assertIsNotNone(c)

time_stamp = time.strftime("%Y-%m-%d %H:%M:%S")
host = socket.gethostname()
slice_name = f"integration test @ {time_stamp} on {host}"

[site1, site2] = fablib.get_random_sites(count=2)
print(f"Sites: {site1}, {site2}")

Expand All @@ -60,7 +65,7 @@ def test_add_l2_measurement_nodes(self):
network_name = "net1"

# Create a slice
slice = fablib.new_slice(name=slice_name)
slice = fablib.new_slice(name=self.slice_name)

# Add an L2 network.
net1 = slice.add_l2network(
Expand Down

0 comments on commit 8eb4c4b

Please sign in to comment.