Extended ZFS states
Build Docker image on push / docker (push) Successful in 23s
Build and push Docker image on tag / docker (push) Successful in 26s

This commit is contained in:
2026-08-17 22:25:19 +02:00
parent ba88e5997a
commit 462eb4f80c
3 changed files with 37 additions and 13 deletions
+18 -4
View File
@@ -55,10 +55,24 @@ func TestFlattenZfsComponents(t *testing.T) {
}
func TestZfsStateNumeric(t *testing.T) {
if got := zfsStateNumeric("ONLINE"); got != 1 {
t.Fatalf("zfsStateNumeric(ONLINE) = %v, want 1", got)
tests := []struct {
state string
want float64
}{
{state: "UNKNOWN", want: 0},
{state: "ONLINE", want: 1},
{state: "DEGRADED", want: 2},
{state: "FAULTED", want: 3},
{state: "OFFLINE", want: 4},
{state: "REMOVED", want: 5},
{state: "UNAVAIL", want: 6},
}
if got := zfsStateNumeric("DEGRADED"); got != 0 {
t.Fatalf("zfsStateNumeric(DEGRADED) = %v, want 0", got)
for _, tt := range tests {
t.Run(tt.state, func(t *testing.T) {
if got := zfsStateNumeric(tt.state); got != tt.want {
t.Fatalf("zfsStateNumeric(%q) = %v, want %v", tt.state, got, tt.want)
}
})
}
}