Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for tempDir (0.19 sec)

  1. cni/pkg/install/kubeconfig_test.go

    		})
    	}
    }
    
    func TestReplaceInvalidKubeconfigFile(t *testing.T) {
    	tmp := t.TempDir()
    	os.WriteFile(filepath.Join(tmp, "token"), []byte(saToken), 0o644)
    	constants.ServiceAccountPath = tmp
    	tempDir := t.TempDir()
    
    	cfg := &config.InstallConfig{
    		MountedCNINetDir: tempDir,
    		KubeCAFile:       kubeCAFilepath,
    		K8sServiceHost:   k8sServiceHost,
    		K8sServicePort:   k8sServicePort,
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Feb 08 03:52:24 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  2. cni/pkg/install/install_test.go

    			// Create temp directory for files
    			tempDir := t.TempDir()
    
    			// Create existing config files if specified in test case
    			for srcFilename, targetFilename := range c.existingConfFiles {
    				if err := file.AtomicCopy(filepath.Join("testdata", srcFilename), tempDir, targetFilename); err != nil {
    					t.Fatal(err)
    				}
    			}
    
    			cfg := &config.InstallConfig{
    				MountedCNINetDir: tempDir,
    				CNIConfName:      c.cniConfName,
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 11.1K bytes
    - Viewed (0)
  3. cni/pkg/install/cniconfig_test.go

    			// Create temp directory for files
    			tempDir := t.TempDir()
    
    			// Create existing config files if specified in test case
    			for _, filename := range c.existingConfFiles {
    				if err := file.AtomicCopy(filepath.Join("testdata", filepath.Base(filename)), tempDir, filepath.Base(filename)); err != nil {
    					t.Fatal(err)
    				}
    			}
    
    			cfg := pluginConfig{
    				mountedCNINetDir: tempDir,
    				cniConfName:      c.specifiedConfName,
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Wed May 17 02:22:22 GMT 2023
    - 15.4K bytes
    - Viewed (0)
  4. cmd/os-readdir_test.go

    	// Add empty entry slice for this test directory.
    	testResults = append(testResults, result{t.TempDir(), []string{}})
    	return testResults
    }
    
    // Test to read non-empty directory with only files.
    func setupTestReadDirFiles(t *testing.T) (testResults []result) {
    	dir := t.TempDir()
    	entries := []string{}
    	for i := 0; i < 10; i++ {
    		name := fmt.Sprintf("file-%d", i)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 7.5K bytes
    - Viewed (0)
  5. cmd/xl-storage_windows_test.go

    		{"/a/b/c/d/e/f/g", true},
    		{string(bytes.Repeat([]byte("界"), 85)), true},
    		// Each path component must be <= 255 bytes long.
    		{string(bytes.Repeat([]byte("界"), 280)), false},
    		{`/p/q/r/s/t`, true},
    	}
    	dir := t.TempDir()
    
    	// Instantiate posix object to manage a disk
    	fs, err := newLocalXLStorage(dir)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// Create volume to use in conjunction with other StorageAPI's file API(s)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Nov 29 06:35:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  6. cni/pkg/install/binaries_test.go

    		},
    	}
    
    	for _, c := range cases {
    		t.Run(c.name, func(t *testing.T) {
    			srcDir := t.TempDir()
    			for filename, contents := range c.srcFiles {
    				file.WriteOrFail(t, filepath.Join(srcDir, filename), []byte(contents))
    			}
    
    			targetDir := t.TempDir()
    			for filename, contents := range c.existingFiles {
    				file.WriteOrFail(t, filepath.Join(targetDir, filename), []byte(contents))
    			}
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Jul 20 18:34:43 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  7. cmd/xl-storage_unix_test.go

    func getUmask() int {
    	mask := syscall.Umask(0)
    	syscall.Umask(mask)
    	return mask
    }
    
    // Tests if the directory and file creations happen with proper umask.
    func TestIsValidUmaskVol(t *testing.T) {
    	tmpPath := t.TempDir()
    	testCases := []struct {
    		volName       string
    		expectedUmask int
    	}{
    		{"is-this-valid", getUmask()},
    	}
    	testCase := testCases[0]
    
    	// Initialize a new xlStorage layer.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Jul 25 19:37:26 GMT 2022
    - 3.4K bytes
    - Viewed (0)
  8. internal/mountinfo/mountinfo_linux_test.go

    		/dev/1    /path/to/1   type1	flags 1 1
    		/dev/2 /path/to/1/2 type2 flags,1,2=3 2 2
                    /dev/3 /path/to/1.1 type3 flags,1,2=3 3 3
    		`
    	var err error
    	dir := t.TempDir()
    	mountsPath := filepath.Join(dir, "mounts")
    	if err = os.WriteFile(mountsPath, []byte(successCase), 0o666); err != nil {
    		t.Fatal(err)
    	}
    	// Failure case where we detected successfully cross device mounts.
    	{
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  9. cmd/bitrot_test.go

    package cmd
    
    import (
    	"context"
    	"io"
    	"testing"
    )
    
    func testBitrotReaderWriterAlgo(t *testing.T, bitrotAlgo BitrotAlgorithm) {
    	tmpDir := t.TempDir()
    
    	volume := "testvol"
    	filePath := "testfile"
    
    	disk, err := newLocalXLStorage(tmpDir)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	disk.MakeVol(context.Background(), volume)
    
    	writer := newBitrotWriter(disk, "", volume, filePath, 35, bitrotAlgo, 10)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  10. cni/pkg/pluginlistener/listener_test.go

    import (
    	"context"
    	"net"
    	"path/filepath"
    	"testing"
    
    	"google.golang.org/grpc"
    	"google.golang.org/grpc/credentials/insecure"
    )
    
    func TestCNIListener(t *testing.T) {
    	f := filepath.Join(t.TempDir(), "test")
    	l, err := NewListener(f)
    	if err != nil {
    		t.Fatalf("unexpected error %v", err)
    	}
    	defer l.Close()
    	conn, err := connect(f)
    	if err != nil {
    		t.Fatalf("failed to connect %v", err)
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Feb 08 21:58:32 GMT 2024
    - 1.4K bytes
    - Viewed (0)
Back to top