Test Setup Examples¶
Static org - Auth enrollment¶
This example shows how to define a WAFT test that will install WARP and enroll the node in the “AutoWARP” organization using auth token enrollment before the test begins.
1import pytest
2
3import waft
4
5from waft import fixture
6
7
8@waft.mark.warp_zero_trust(organization='AutoWARP')
9def test_example(warp: fixture.warp):
10 """This test definition serves as an example of how to define a test
11 that will enroll the node in a static organization using token authentication"""
12 # Test process will go here
Static org - Email enrollment¶
This example shows how to define a WAFT test that will install WARP and enroll the node in the “AutoWARP” organization using email enrollment before the test begins.
1import pytest
2
3import waft
4
5from waft import fixture
6
7
8@waft.mark.warp_zero_trust(organization='AutoWARP', enroll='identity')
9def test_example(warp: fixture.warp):
10 """This test definition serves as an example of how to define a test
11 that will enroll the node in a static organization using email authentication"""
12 # Test process will go here
Single Device Profile¶
This example shows how to define a WAFT test that only needs a single device profile to do testing (no actions are needed to be taken outside that single device profile). WARP will be installed and then the device will be enrolled using email (to specify device profile) in the org that is reserved for single device profile tests.
1import pytest
2
3import waft
4
5from waft import fixture
6
7
8@waft.mark.warp_zero_trust() # This marker is still used since the test will be testing the zero trust product.
9def test_example(warp: fixture.warp, single_device_profile: fixture.single_device_profile):
10 """This test definition serves as an example of how to define a test
11 that will enroll the node in a static organization using email authentication"""
12 # Test process will go here
13 # Device profile created for test instance will be accessible through the single_device_profile fixture
Dynamic Organization - Auth enrollment¶
This example shows how to define a WAFT test that will use a dynamic organization and enroll by Auth token. These are organizations that are maintained in a nominal state before being used for tests.
1import pytest
2import waft
3
4from waft import fixture
5
6
7@waft.mark.warp_zero_trust(dynamic=True)
8def test_example(warp: fixture.warp, dashboard: fixture.dashboard):
9 """This test definition serves as an example of how to define a test
10 that will enroll the node in a static organization using token authentication"""
11 # Test process will go here