oci: FreeBSD devices may have major number 0
Signed-off-by: Samuel Karp <me@samuelkarp.com>
This commit is contained in:
parent
2ab8c12fc8
commit
c15f0cdaf0
@ -23,6 +23,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -149,9 +150,11 @@ func TestHostDevicesAllValid(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, device := range devices {
|
for _, device := range devices {
|
||||||
// Devices can't have major number 0.
|
if runtime.GOOS != "freebsd" {
|
||||||
if device.Major == 0 {
|
// On Linux, devices can't have major number 0.
|
||||||
t.Errorf("device entry %+v has zero major number", device)
|
if device.Major == 0 {
|
||||||
|
t.Errorf("device entry %+v has zero major number", device)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch device.Type {
|
switch device.Type {
|
||||||
case blockDevice, charDevice:
|
case blockDevice, charDevice:
|
||||||
|
Loading…
Reference in New Issue
Block a user