Conditionally skip node reassignment test where version >= 0.28.0

This commit is contained in:
Paul Kronenwetter
2026-02-06 13:54:46 -05:00
parent 0d0b5f88a1
commit b38b733e9f
2 changed files with 14 additions and 7 deletions
+9 -7
View File
@@ -1,5 +1,5 @@
import { describe, expect, test } from 'vitest';
import { getNode, getRuntimeClient, HS_VERSIONS } from './setup/env';
import { getNode, getRuntimeClient, getIsAtLeast, HS_VERSIONS } from './setup/env';
describe.sequential.for(HS_VERSIONS)('Headscale %s: Users', (version) => {
let workingNodeId: string;
@@ -41,13 +41,15 @@ describe.sequential.for(HS_VERSIONS)('Headscale %s: Users', (version) => {
});
test('nodes can be reassigned to another user', async () => {
const client = await getRuntimeClient(version);
const user = await client.createUser('node-reassign@');
if (! getIsAtLeast("0.28.0")) {
const client = await getRuntimeClient(version);
const user = await client.createUser('node-reassign@');
await client.setNodeUser(workingNodeId, user.id);
const reassignedNode = await client.getNode(workingNodeId);
expect(reassignedNode).toBeDefined();
expect(reassignedNode.user.name).toBe(user.name);
await client.setNodeUser(workingNodeId, user.id);
const reassignedNode = await client.getNode(workingNodeId);
expect(reassignedNode).toBeDefined();
expect(reassignedNode.user.name).toBe(user.name);
}
});
test('nodes can be expired', async () => {
+5
View File
@@ -43,6 +43,11 @@ export async function getRuntimeClient(version: Version) {
return bootstrap.getRuntimeClient(env.apiKey);
}
export async function getIsAtLeast(version: Version) {
const { env, bootstrap } = await ensureVersion(version);
return bootstrap.clientHelpers.isAtleast;
}
export async function getNode(version: Version) {
const { tailscaleNode } = await ensureVersion(version);
return {