Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for newTestPlugin (0.15 sec)

  1. pkg/volume/csi/csi_plugin_test.go

    	})
    }
    
    func TestPluginGetPluginName(t *testing.T) {
    	plug, tmpDir := newTestPlugin(t, nil)
    	defer os.RemoveAll(tmpDir)
    	if plug.GetPluginName() != "kubernetes.io/csi" {
    		t.Errorf("unexpected plugin name %v", plug.GetPluginName())
    	}
    }
    
    func TestPluginGetVolumeName(t *testing.T) {
    	plug, tmpDir := newTestPlugin(t, nil)
    	defer os.RemoveAll(tmpDir)
    	testCases := []struct {
    		name       string
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 41.8K bytes
    - Viewed (0)
  2. pkg/volume/csi/csi_block_test.go

    	if err != nil {
    		t.Fatalf("Failed to create a fakeDriver: %v", err)
    	}
    
    	// after the driver is created, create the plugin. newTestPlugin waits for the informer to sync,
    	// such that csiMapper.SetUpDevice below sees the VolumeAttachment object in the lister.
    
    	plug, tmpDir := newTestPlugin(t, fakeClient)
    	defer os.RemoveAll(tmpDir)
    
    	csiMapper, _, _, err := prepareBlockMapperTest(plug, "test-pv", t)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 11 06:07:40 UTC 2023
    - 26.5K bytes
    - Viewed (0)
  3. pkg/volume/csi/testing/testing.go

    	utiltesting "k8s.io/client-go/util/testing"
    	"k8s.io/kubernetes/pkg/volume"
    	"k8s.io/kubernetes/pkg/volume/csi"
    	volumetest "k8s.io/kubernetes/pkg/volume/testing"
    )
    
    // NewTestPlugin creates a plugin mgr to load plugins and setup a fake client
    func NewTestPlugin(t *testing.T, client *fakeclient.Clientset) (*volume.VolumePluginMgr, *volume.VolumePlugin, string) {
    	tmpDir, err := utiltesting.MkTmpdir("csi-test")
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jan 07 00:11:50 UTC 2021
    - 2.2K bytes
    - Viewed (0)
  4. pkg/volume/plugins_test.go

    	return ReconstructedVolume{}, nil
    }
    
    func newTestPlugin() []VolumePlugin {
    	return []VolumePlugin{&testPlugins{}}
    }
    
    func TestVolumePluginMgrFunc(t *testing.T) {
    	vpm := VolumePluginMgr{}
    	var prober DynamicPluginProber = nil // TODO (#51147) inject mock
    	vpm.InitPlugins(newTestPlugin(), prober, nil)
    
    	plug, err := vpm.FindPluginByName(testPluginName)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 14 06:17:25 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  5. pkg/volume/csi/expander_test.go

    					"apiUsername": []byte("csiusername"),
    					"apiPassword": []byte("csipassword"),
    				},
    			},
    		},
    	}
    	for _, tc := range tests {
    		t.Run(tc.name, func(t *testing.T) {
    			plug, tmpDir := newTestPlugin(t, nil)
    			defer os.RemoveAll(tmpDir)
    
    			spec := volume.NewSpecFromPersistentVolume(makeTestPV("test-pv", 10, "expandable", "test-vol"), false)
    			if tc.enableCSINodeExpandSecret {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 01 03:58:36 UTC 2023
    - 6.6K bytes
    - Viewed (0)
  6. pkg/volume/csi/csi_mounter_test.go

    		return fmt.Errorf("failed to save volume info file: %s", err)
    	}
    	return nil
    }
    
    func TestMounterGetPath(t *testing.T) {
    	plug, tmpDir := newTestPlugin(t, nil)
    	defer os.RemoveAll(tmpDir)
    
    	// TODO (vladimirvivien) specName with slashes will not work
    	testCases := []struct {
    		name           string
    		specVolumeName string
    		path           string
    	}{
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 50.1K bytes
    - Viewed (0)
  7. pkg/volume/csi/csi_attacher_test.go

    				getTestCSIDriver("nil", nil, nil, nil),
    				&v1.Node{
    					ObjectMeta: metav1.ObjectMeta{
    						Name: "fakeNode",
    					},
    					Spec: v1.NodeSpec{},
    				},
    			)
    			plug, tmpDir := newTestPlugin(t, fakeClient)
    			defer os.RemoveAll(tmpDir)
    
    			attacher, err := plug.NewAttacher()
    			if err != nil {
    				t.Fatalf("failed to create new attacher: %v", err)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 12:23:16 UTC 2024
    - 58.1K bytes
    - Viewed (0)
  8. pkg/volume/csi/csi_util_test.go

    		driver.Spec.SELinuxMount = &seLinuxMountSupport
    	case "no_selinux":
    		driver.Spec.SELinuxMount = &noSElinuxMountSupport
    	}
    	return driver
    }
    
    func TestSaveVolumeData(t *testing.T) {
    	plug, tmpDir := newTestPlugin(t, nil)
    	defer os.RemoveAll(tmpDir)
    	testCases := []struct {
    		name       string
    		data       map[string]string
    		shouldFail bool
    	}{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 20 14:49:03 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  9. pkg/volume/util/operationexecutor/operation_generator_test.go

    }
    
    func initTestPlugins(t *testing.T, plugs []volume.VolumePlugin, pluginName string) (*volume.VolumePluginMgr, string) {
    	client := fakeclient.NewSimpleClientset()
    	pluginMgr, _, tmpDir := csitesting.NewTestPlugin(t, client)
    
    	err := pluginMgr.InitPlugins(plugs, nil, pluginMgr.Host)
    	if err != nil {
    		t.Fatalf("Can't init volume plugins: %v", err)
    	}
    
    	_, e := pluginMgr.FindPluginByName(pluginName)
    	if e != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 16.2K bytes
    - Viewed (0)
  10. pkg/scheduler/framework/runtime/framework_test.go

    type PluginNotImplementingScore struct{}
    
    func (pl *PluginNotImplementingScore) Name() string {
    	return pluginNotImplementingScore
    }
    
    func newTestPlugin(_ context.Context, injArgs runtime.Object, f framework.Handle) (framework.Plugin, error) {
    	return &TestPlugin{name: testPlugin}, nil
    }
    
    // TestPlugin implements all Plugin interfaces.
    type TestPlugin struct {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 17 09:07:27 UTC 2024
    - 103K bytes
    - Viewed (0)
Back to top