|
1 | 1 | setup() { |
2 | 2 | bats_load_library bats-support |
3 | 3 | bats_load_library bats-assert |
| 4 | + |
| 5 | + bats_require_minimum_version 1.5.0 |
| 6 | +} |
| 7 | + |
| 8 | +wait_for_exporter() { |
| 9 | + kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \ |
| 10 | + exporters.jumpstarter.dev/test-exporter-oidc |
| 11 | + kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \ |
| 12 | + exporters.jumpstarter.dev/test-exporter-sa |
| 13 | + kubectl -n default wait --timeout 20m --for=condition=Online --for=condition=Registered \ |
| 14 | + exporters.jumpstarter.dev/test-exporter-legacy |
4 | 15 | } |
5 | 16 |
|
6 | 17 | @test "can create clients with admin cli" { |
@@ -78,17 +89,12 @@ while true; do |
78 | 89 | done |
79 | 90 | EOF |
80 | 91 |
|
81 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
82 | | - exporters.jumpstarter.dev/test-exporter-oidc |
83 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
84 | | - exporters.jumpstarter.dev/test-exporter-sa |
85 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
86 | | - exporters.jumpstarter.dev/test-exporter-legacy |
| 92 | + |
| 93 | + wait_for_exporter |
87 | 94 | } |
88 | 95 |
|
89 | 96 | @test "can specify client config only using environment variables" { |
90 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
91 | | - exporters.jumpstarter.dev/test-exporter-oidc |
| 97 | + wait_for_exporter |
92 | 98 |
|
93 | 99 | JMP_NAMEPSACE=default \ |
94 | 100 | JMP_NAME=test-exporter-legacy \ |
|
98 | 104 | } |
99 | 105 |
|
100 | 106 | @test "can operate on leases" { |
101 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
102 | | - exporters.jumpstarter.dev/test-exporter-oidc |
| 107 | + wait_for_exporter |
103 | 108 |
|
104 | 109 | jmp config client use test-client-oidc |
105 | 110 |
|
|
110 | 115 | } |
111 | 116 |
|
112 | 117 | @test "can lease and connect to exporters" { |
113 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
114 | | - exporters.jumpstarter.dev/test-exporter-oidc |
115 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
116 | | - exporters.jumpstarter.dev/test-exporter-sa |
117 | | - kubectl -n default wait --for=condition=Online --for=condition=Registered \ |
118 | | - exporters.jumpstarter.dev/test-exporter-legacy |
| 118 | + wait_for_exporter |
119 | 119 |
|
120 | 120 | jmp shell --client test-client-oidc --selector example.com/board=oidc j power on |
121 | 121 | jmp shell --client test-client-sa --selector example.com/board=sa j power on |
|
0 commit comments