Skip to content

Commit ee705c6

Browse files
committed
test: extend tests to cover the new operator behavior
1 parent fe40ea7 commit ee705c6

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

test/tailscale/scenarios.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
},
3131
"tailscale_operator": {
3232
"image": "ubuntu:latest",
33+
"containerEnv": {
34+
"TS_AUTH_KEY": "test-auth-key"
35+
},
3336
"features": {
3437
"tailscale": {
3538
"operator": "$USER"

test/tailscale/tailscale_operator.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/tailscale/tailscale_operator.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Tailscale Inc & AUTHORS All rights reserved.
3+
# Use of this source code is governed by a BSD-style
4+
# license that can be found in the LICENSE file.
5+
6+
set -e
7+
8+
source dev-container-features-test-lib
9+
10+
# Wait for the auth key to be seen by the start script.
11+
count=100
12+
while ((count--)); do
13+
[[ -f /tmp/test-auth-key-seen ]] && break
14+
sleep 0.1
15+
done
16+
17+
tailscale debug prefs | grep -q OperatorUser
18+
19+
check "tailscale operator is set" bash -c 'tailscale debug prefs | grep -q OperatorUser'
20+
21+
reportResults

test/tailscale/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ if [[ -n "$VERSION" ]]; then
1313
check "version is correct" bash -c "tailscale version --daemon | grep -q $VERSION"
1414
fi
1515

16-
reportResults
16+
check "tailscale operator is not set" bash -c '! ( tailscale debug prefs | grep -q OperatorUser )'
17+
18+
reportResults

0 commit comments

Comments
 (0)