2019-10-22 13:20:26 +00:00
|
|
|
package csimanager
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/nomad/client/dynamicplugins"
|
|
|
|
"github.com/hashicorp/nomad/helper/testlog"
|
|
|
|
"github.com/hashicorp/nomad/plugins/csi/fake"
|
|
|
|
)
|
|
|
|
|
|
|
|
func setupTestNodeInstanceManager(t *testing.T) (*fake.Client, *instanceManager) {
|
|
|
|
tp := &fake.Client{}
|
|
|
|
|
|
|
|
logger := testlog.HCLogger(t)
|
|
|
|
pinfo := &dynamicplugins.PluginInfo{
|
|
|
|
Name: "test-plugin",
|
|
|
|
}
|
|
|
|
|
|
|
|
return tp, &instanceManager{
|
2020-01-08 12:47:07 +00:00
|
|
|
logger: logger,
|
|
|
|
info: pinfo,
|
|
|
|
client: tp,
|
|
|
|
fp: &pluginFingerprinter{
|
|
|
|
logger: logger.Named("fingerprinter"),
|
|
|
|
info: pinfo,
|
|
|
|
client: tp,
|
|
|
|
fingerprintNode: true,
|
2019-10-22 13:20:26 +00:00
|
|
|
},
|
2019-12-18 12:24:39 +00:00
|
|
|
}
|
|
|
|
}
|