forked from adamlaska/machine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredhat_test.go
More file actions
43 lines (36 loc) · 1.04 KB
/
redhat_test.go
File metadata and controls
43 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package provision
import (
"regexp"
"testing"
"github.com/docker/machine/drivers/fakedriver"
"github.com/docker/machine/libmachine/auth"
"github.com/docker/machine/libmachine/engine"
"github.com/docker/machine/libmachine/provision/provisiontest"
"github.com/docker/machine/libmachine/swarm"
)
func TestRedHatGenerateYumRepoList(t *testing.T) {
info := &OsRelease{
ID: "rhel",
}
p := NewRedHatProvisioner("rhel", nil)
p.SetOsReleaseInfo(info)
buf, err := generateYumRepoList(p)
if err != nil {
t.Fatal(err)
}
m, err := regexp.MatchString(".*centos/7.*", buf.String())
if err != nil {
t.Fatal(err)
}
if !m {
t.Fatalf("expected match for centos/7")
}
}
func TestRedHatDefaultStorageDriver(t *testing.T) {
p := NewRedHatProvisioner("", &fakedriver.Driver{})
p.SSHCommander = provisiontest.NewFakeSSHCommander(provisiontest.FakeSSHCommanderOptions{})
p.Provision(swarm.Options{}, auth.Options{}, engine.Options{})
if p.EngineOptions.StorageDriver != "devicemapper" {
t.Fatal("Default storage driver should be devicemapper")
}
}