Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 147 for mock (0.14 sec)

  1. cni/pkg/ipset/nldeps_mock.go

    // See the License for the specific language governing permissions and
    // limitations under the License.
    
    package ipset
    
    import (
    	"net/netip"
    
    	"github.com/stretchr/testify/mock"
    )
    
    type MockedIpsetDeps struct {
    	mock.Mock
    }
    
    func FakeNLDeps() *MockedIpsetDeps {
    	return &MockedIpsetDeps{}
    }
    
    func (m *MockedIpsetDeps) ipsetIPPortCreate(name string) error {
    	args := m.Called(name)
    	return args.Error(0)
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  2. istioctl/pkg/cli/mock_client.go

    Xiaopeng Han <******@****.***> 1709887099 +0800
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Mar 08 08:38:19 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/informers_test.go

    // See the License for the specific language governing permissions and
    // limitations under the License.
    
    package nodeagent
    
    import (
    	"context"
    	"fmt"
    	"testing"
    	"time"
    
    	"github.com/stretchr/testify/mock"
    	corev1 "k8s.io/api/core/v1"
    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    	"k8s.io/apimachinery/pkg/types"
    
    	"istio.io/istio/cni/pkg/util"
    	"istio.io/istio/pkg/config/constants"
    	"istio.io/istio/pkg/kube"
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Feb 08 01:03:24 GMT 2024
    - 15.8K bytes
    - Viewed (0)
  4. cni/pkg/plugin/plugin_test.go

    }
    
    func buildMockConf(ambientEnabled bool, eventURL string) string {
    	return fmt.Sprintf(
    		mockConfTmpl,
    		"1.0.0",
    		"1.0.0",
    		"eth0",
    		testSandboxDirectory,
    		eventURL,
    		ambientEnabled,
    		"mock",
    	)
    }
    
    func buildFakePodAndNSForClient() (*corev1.Pod, *corev1.Namespace) {
    	proxy := corev1.Container{Name: "mockContainer"}
    	app := corev1.Container{Name: "foo-init"}
    	fakePod := &corev1.Pod{
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Feb 10 00:31:55 GMT 2024
    - 17.5K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/cni-watcher_test.go

    		Status: corev1.PodStatus{
    			PodIP: fakePodIP,
    		},
    	}
    	ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "funkyns"}}
    
    	client := kube.NewFakeClient(ns, pod)
    
    	// We are expecting at most 1 calls to the mock, wait for them
    	wg, waitForMockCalls := NewWaitForNCalls(t, 1)
    	fs := &fakeServer{testWG: wg}
    
    	fs.On("AddPodToMesh",
    		ctx,
    		pod,
    		util.GetPodIPsIfPresent(pod),
    		valid.Netns,
    	).Return(nil)
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Feb 02 08:18:40 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  6. cni/pkg/nodeagent/server_test.go

    			UID:       types.UID("test"),
    			Annotations: map[string]string{
    				constants.AmbientRedirection: constants.AmbientRedirectionEnabled,
    			},
    		},
    	}
    }
    
    type fakeServer struct {
    	mock.Mock
    	testWG *WaitGroup // optional waitgroup, if code under test makes a number of async calls to fakeServer
    }
    
    func (f *fakeServer) AddPodToMesh(ctx context.Context, pod *corev1.Pod, podIPs []netip.Addr, netNs string) error {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  7. cni/pkg/nodeagent/fakes_test.go

    }
    
    func (f *fakeZtunnel) PodAdded(ctx context.Context, pod *corev1.Pod, netns Netns) error {
    	f.addedPods.Add(1)
    	return f.addError
    }
    
    func (f *fakeZtunnel) Close() error {
    	return nil
    }
    
    // fakeNs is a mock struct for testing
    type fakeNs struct {
    	closed *atomic.Bool
    	fd     uintptr
    	inode  uint64
    }
    
    func newFakeNs(fd uintptr) *fakeNs {
    	// the fake inode is the fd! magic.
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  8. tests/sql_builder_test.go

    	// replace SQL quote, convert into postgresql like ""
    	expected = replaceQuoteInSQL(expected)
    	actually = replaceQuoteInSQL(actually)
    
    	// ignore updated_at value, because it's generated in Gorm internal, can't to mock value on update.
    	updatedAtRe := regexp.MustCompile(`(?i)"updated_at"=".+?"`)
    	actually = updatedAtRe.ReplaceAllString(actually, `"updated_at"=?`)
    	expected = updatedAtRe.ReplaceAllString(expected, `"updated_at"=?`)
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  9. cmd/sts-handlers_test.go

    	}
    
    	// Generate web identity STS token by interacting with OpenID IDP.
    	token, err := MockOpenIDTestUserInteraction(ctx, testAppParams, "******@****.***", "dillon")
    	if err != nil {
    		c.Fatalf("mock user err: %v", err)
    	}
    	// fmt.Printf("TOKEN: %s\n", token)
    
    	webID := cr.STSWebIdentity{
    		Client:      s.TestSuiteCommon.client,
    		STSEndpoint: s.endPoint,
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 18 19:09:19 GMT 2024
    - 84.7K bytes
    - Viewed (0)
  10. internal/bucket/object/lock/lock.go

    	AmzObjectLockRetainUntilDate     = "X-Amz-Object-Lock-Retain-Until-Date"
    	AmzObjectLockMode                = "X-Amz-Object-Lock-Mode"
    	AmzObjectLockLegalHold           = "X-Amz-Object-Lock-Legal-Hold"
    )
    
    var (
    	// ErrMalformedBucketObjectConfig -indicates that the bucket object lock config is malformed
    	ErrMalformedBucketObjectConfig = errors.New("invalid bucket object lock config")
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 17.1K bytes
    - Viewed (0)
Back to top