mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
devicemapper: Fix tests on fedora
If /dev/loop-control exists on the system running the test then ioctlLoopCtlGetFree() will be called, but if not it won't. It does not exist in the standard docker build environment, so the tests currently require this to not be called. This makes it instead optional, allowing the tests to run on e.g. Fedora. Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
This commit is contained in:
parent
8228e50581
commit
eb4578daee
1 changed files with 8 additions and 1 deletions
|
@ -136,7 +136,12 @@ type Set map[string]bool
|
|||
|
||||
func (r Set) Assert(t *testing.T, names ...string) {
|
||||
for _, key := range names {
|
||||
if _, exists := r[key]; !exists {
|
||||
required := true
|
||||
if strings.HasPrefix(key, "?") {
|
||||
key = key[1:]
|
||||
required = false
|
||||
}
|
||||
if _, exists := r[key]; !exists && required {
|
||||
t.Fatalf("Key not set: %s", key)
|
||||
}
|
||||
delete(r, key)
|
||||
|
@ -486,6 +491,7 @@ func TestDriverCreate(t *testing.T) {
|
|||
"ioctl.blkgetsize",
|
||||
"ioctl.loopsetfd",
|
||||
"ioctl.loopsetstatus",
|
||||
"?ioctl.loopctlgetfree",
|
||||
)
|
||||
|
||||
if err := d.Create("1", ""); err != nil {
|
||||
|
@ -603,6 +609,7 @@ func TestDriverRemove(t *testing.T) {
|
|||
"ioctl.blkgetsize",
|
||||
"ioctl.loopsetfd",
|
||||
"ioctl.loopsetstatus",
|
||||
"?ioctl.loopctlgetfree",
|
||||
)
|
||||
|
||||
if err := d.Create("1", ""); err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue