Skip to content

Commit b104f33

Browse files
authored
Add routing table and routing table route TypeScript unit tests (#103)
Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent b4cbd12 commit b104f33

8 files changed

Lines changed: 4372 additions & 4 deletions

File tree

package-lock.json

Lines changed: 203 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"network_interface_unit_test": "file:tests/ts/iaas/network-interface",
1818
"network_unit_test": "file:tests/ts/iaas/network",
1919
"public_ip_unit_test": "file:tests/ts/iaas/public_ip",
20+
"routing_table_unit_test": "file:tests/ts/iaas/routingTable",
2021
"securitygroup_unit_test": "file:tests/ts/iaas/securityGroup"
2122
}
2223
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: routing_table_unit_test
2+
description: A minimal TypeScript Pulumi program
3+
runtime:
4+
name: nodejs
5+
options:
6+
packagemanager: npm
7+
config:
8+
pulumi:tags:
9+
value:
10+
pulumi:template: typescript
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import * as pulumi from "@pulumi/pulumi";
2+
import * as stackit from "@stackitcloud/pulumi-stackit";
3+
4+
export const routingTableOrganizationId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
5+
export const routingTableNetworkAreaId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx1";
6+
export const routingTableId = "routingTable-id";
7+
export const routingTableRouteId = "routingTableRoute-id";
8+
9+
export const routingTableRouteLabelKey = "unit-test";
10+
export const routingTableRouteLabelValue = "test-label-value";
11+
export const routingTableRouteDestinationType = "cidrv4";
12+
export const routingTableRouteDestinationValue = "192.168.178.0/24";
13+
export const routingTableRouteNextHopType = "ipv4";
14+
export const routingTableRouteNextHopValue = "192.168.178.1";
15+
16+
export const exampleRoutingTable = new stackit.RoutingTable("exampleRoutingTable", {
17+
organizationId: routingTableOrganizationId,
18+
networkAreaId: routingTableNetworkAreaId,
19+
});
20+
21+
// only labels are optional therefore one unit test
22+
export const exampleRoutingTableRoute = new stackit.RoutingTableRoute("exampleRoutingTableRoute", {
23+
organizationId: routingTableOrganizationId,
24+
networkAreaId: routingTableNetworkAreaId,
25+
routingTableId: routingTableId,
26+
destination: {
27+
type: routingTableRouteDestinationType,
28+
value: routingTableRouteDestinationValue,
29+
},
30+
nextHop: {
31+
type: routingTableRouteNextHopType,
32+
value: routingTableRouteNextHopValue,
33+
},
34+
labels: {[routingTableRouteLabelKey]:routingTableRouteLabelValue},
35+
});
36+
37+
// datasource
38+
export const routingTableDatasource = stackit.getRoutingTableOutput({
39+
organizationId: routingTableOrganizationId,
40+
networkAreaId: routingTableNetworkAreaId,
41+
routingTableId: routingTableId,
42+
});
43+
44+
export const routingTableRouteDatasource = stackit.getRoutingTableRouteOutput({
45+
organizationId: routingTableOrganizationId,
46+
networkAreaId: routingTableNetworkAreaId,
47+
routingTableId: routingTableId,
48+
routeId: routingTableRouteId,
49+
});

0 commit comments

Comments
 (0)