Show disk, pool and unassigned Linux capacity in device fleet views

This commit is contained in:
2026-11-20 09:35:05 +01:00
parent eaaa6ff228
commit 79f236b3ea
4 changed files with 53 additions and 1 deletions
+14
View File
@@ -30,6 +30,7 @@ test('shows used disk and RAM in GiB and draws the occupied share in red on desk
['missing-available', null, 16 * gib],
['invalid-range', 17 * gib, 16 * gib],
['invalid-total', 0, 0],
['linux-drives', null, null],
] as const;
const listing = (items: unknown[]) => ({
items, next_cursor: null, truncated: false, completeness: 'complete', as_of: '2026-11-19T12:00:00Z'
@@ -49,6 +50,11 @@ test('shows used disk and RAM in GiB and draws the occupied share in red on desk
tenant_id: customer.tenant_id, customer_name: customer.name, asset_id: hostname, agent_id: hostname,
lifecycle: 'current', status: 'online', hostname, ram_available_bytes: free, ram_total_bytes: total,
disk_free_bytes: free, disk_total_bytes: total,
...(hostname === 'linux-drives' ? {disks:[
{kind:'disk',name:'sda',model:'Testplatte',total_bytes:64*gib,used_bytes:16*gib,available_bytes:40*gib},
{kind:'disk',name:'sdb',total_bytes:64*gib,used_bytes:null,available_bytes:null},
{kind:'group',name:'md0',members:['sda','sdb'],total_bytes:8*gib,used_bytes:2*gib,available_bytes:6*gib}
]} : {}),
...(hostname === 'mostly-free' ? { volumes: [
{ name: 'C:', free_bytes: free, total_bytes: total },
{ name: 'D:', free_bytes: 0, total_bytes: 64 * gib },
@@ -92,6 +98,14 @@ test('shows used disk and RAM in GiB and draws the occupied share in red on desk
await expect(drives.nth(1).getByRole('img', { name: '100 % belegt, 0 % frei' })).toBeVisible();
await expect(drives.nth(2)).toHaveText('E: Nicht gemeldet');
await expect(drives.nth(2).getByRole('img')).toHaveCount(0);
const linux = row('linux-drives').locator('.drive-capacity');
await expect(linux).toHaveCount(3);
await expect(linux.nth(0)).toContainText('16 / 64 GiB');
await expect(linux.nth(0).getByRole('img',{name:'25 % belegt, 62,5 % frei, 12,5 % nicht zugeordnet'})).toBeVisible();
await expect(linux.nth(1)).toContainText('Belegung nicht ermittelbar');
await expect(linux.nth(1)).toContainText('Im Verbund: md0');
await expect(linux.nth(2)).toContainText('Verbund: md0');
await expect(linux.nth(2)).toContainText('2 / 8 GiB');
}
});