A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
test-ns3.DockerContainerManager Class Reference

Python-on-whales wrapper for Docker-based ns-3 tests. More...

Public Member Functions

 __init__ (self, unittest.TestCase currentTestCase, str containerName="ubuntu:latest")
 Create and start container with containerName in the current ns-3 directory.
 
 __enter__ (self)
 Return the managed container when entiring the block "with DockerContainerManager() as container".
 
 __exit__ (self, exc_type, exc_val, exc_tb)
 Clean up the managed container at the end of the block "with DockerContainerManager() as container".
 

Public Attributes

 container
 The Python-on-whales container instance.
 

Detailed Description

Python-on-whales wrapper for Docker-based ns-3 tests.

Definition at line 187 of file test-ns3.py.

Constructor & Destructor Documentation

◆ __init__()

test-ns3.DockerContainerManager.__init__ ( self,
unittest.TestCase currentTestCase,
str containerName = "ubuntu:latest" )

Create and start container with containerName in the current ns-3 directory.

Parameters
selfthe current DockerContainerManager instance
currentTestCasethe test case instance creating the DockerContainerManager
containerNamename of the container image to be used

Definition at line 192 of file test-ns3.py.

Member Function Documentation

◆ __enter__()

test-ns3.DockerContainerManager.__enter__ ( self)

Return the managed container when entiring the block "with DockerContainerManager() as container".

Parameters
selfthe current DockerContainerManager instance
Returns
container managed by DockerContainerManager.

Definition at line 234 of file test-ns3.py.

References test-ns3.DockerContainerManager.container.

◆ __exit__()

test-ns3.DockerContainerManager.__exit__ ( self,
exc_type,
exc_val,
exc_tb )

Clean up the managed container at the end of the block "with DockerContainerManager() as container".

Parameters
selfthe current DockerContainerManager instance
exc_typeunused parameter
exc_valunused parameter
exc_tbunused parameter
Returns
None

Definition at line 242 of file test-ns3.py.

References test-ns3.DockerContainerManager.container.

Member Data Documentation

◆ container

test-ns3.DockerContainerManager.container

The Python-on-whales container instance.

Definition at line 219 of file test-ns3.py.

Referenced by test-ns3.DockerContainerManager.__enter__(), and test-ns3.DockerContainerManager.__exit__().


The documentation for this class was generated from the following file: