Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for NewFakeContext (0.19 sec)

  1. istioctl/pkg/workload/workload_test.go

    			expectedException: false,
    			expectedOutput:    customYAML,
    		},
    	}
    
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, c.description), func(t *testing.T) {
    			verifyTestcaseOutput(t, Cmd(cli.NewFakeContext(nil)), c)
    		})
    	}
    }
    
    func verifyTestcaseOutput(t *testing.T, cmd *cobra.Command, c testcase) {
    	t.Helper()
    
    	var out bytes.Buffer
    	cmd.SetArgs(c.args)
    	cmd.SetOut(&out)
    	cmd.SetErr(&out)
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Thu Aug 01 20:04:20 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  2. istioctl/pkg/metrics/metrics_test.go

    			WantException:  true,
    		},
    		{ // case 1
    			Args:           strings.Split("details", " "),
    			ExpectedOutput: "Error: no Prometheus pods found\n",
    			WantException:  true,
    		},
    	}
    
    	metricCmd := Cmd(cli.NewFakeContext(nil))
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.Args, " ")), func(t *testing.T) {
    			testutil.VerifyOutput(t, metricCmd, c)
    		})
    	}
    }
    
    func TestMetrics(t *testing.T) {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Fri Aug 16 01:35:47 UTC 2024
    - 8K bytes
    - Viewed (0)
  3. istioctl/pkg/authz/authz_test.go

    			ExpectedOutput: `ACTION   AuthorizationPolicy         RULES
    ALLOW    _anonymous_match_nothing_   1
    ALLOW    httpbin.default             1
    `,
    		},
    	}
    
    	authzCmd := checkCmd(cli.NewFakeContext(&cli.NewFakeContextOption{}))
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.Args, " ")), func(t *testing.T) {
    			testutil.VerifyOutput(t, authzCmd, c)
    		})
    	}
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Jun 21 14:20:23 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  4. istioctl/pkg/analyze/analyze_test.go

    	c := testutil.TestCase{
    		Args: strings.Split(
    			"-A --use-kube=false --failure-threshold ERROR testdata/analyze-file/public-gateway.yaml",
    			" "),
    		WantException: false,
    	}
    	analyze := Analyze(cli.NewFakeContext(nil))
    	testutil.VerifyOutput(t, analyze, c)
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  5. istioctl/pkg/proxyconfig/proxyconfig_test.go

    			wantException:    true,
    		},
    	}
    
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.args, " ")), func(t *testing.T) {
    			verifyExecTestOutput(t, ProxyConfig(cli.NewFakeContext(&cli.NewFakeContextOption{
    				Results:   c.execClientConfig,
    				Namespace: "default",
    			})), c)
    		})
    	}
    }
    
    func verifyExecTestOutput(t *testing.T, cmd *cobra.Command, c execTestCase) {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Apr 10 21:51:29 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  6. istioctl/pkg/kubeinject/kubeinject_test.go

    					" --valuesFile testdata/inject-values.yaml",
    				" "),
    			GoldenFilename: "testdata/deployment/hello-with-proxyconfig-anno.yaml.injected",
    		},
    	}
    
    	kubeInject := InjectCommand(cli.NewFakeContext(nil))
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.Args, " ")), func(t *testing.T) {
    			testutil.VerifyOutput(t, kubeInject, c)
    			cleanUpKubeInjectTestEnv()
    		})
    	}
    }
    
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Thu Jun 15 15:02:17 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. istioctl/pkg/waypoint/waypoint_test.go

    				makeGatewayWithRevision("bookinfo-rev", "bookinfo", true, true, "rev1"),
    			},
    			expectedOutFile: "combined-gateway",
    		},
    	}
    	for _, tt := range cases {
    		t.Run(tt.name, func(t *testing.T) {
    			ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    				Namespace: "default",
    			})
    			client, err := ctx.CLIClient()
    			if err != nil {
    				t.Fatal(err)
    			}
    
    			for _, gw := range tt.gateways {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Thu Apr 04 15:53:09 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  8. istioctl/pkg/precheck/precheck_test.go

    		// minor <= 21 and checkTracing failing
    	}
    
    	for _, c := range cases {
    		t.Run(fmt.Sprintf("revision=%s, version=%s", c.revision, c.version), func(t *testing.T) {
    			ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    				IstioNamespace: "istio-system",
    			})
    			output, err := checkFromVersion(ctx, c.revision, c.version)
    
    			assert.Equal(t, output, c.expectedOutput)
    
    			if c.expectedError != nil {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Tue Jul 09 12:01:22 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  9. istioctl/pkg/internaldebug/internal-debug_test.go

    	}
    	t.Cleanup(func() {
    		multixds.GetXdsResponse = xds.GetXdsResponse
    	})
    
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.args, " ")), func(t *testing.T) {
    			ctx := cli.NewFakeContext(&cli.NewFakeContextOption{
    				IstioNamespace: "istio-system",
    			})
    			if !c.noIstiod {
    				client, err := ctx.CLIClientWithRevision(c.revision)
    				assert.NoError(t, err)
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Fri Mar 15 08:28:50 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  10. istioctl/pkg/dashboard/dashboard_test.go

    			Args:           strings.Split("envoy --browser=false pod-123456-7890", " "),
    			ExpectedRegexp: regexp.MustCompile("http://localhost:3456"),
    			WantException:  false,
    		},
    	}
    
    	dbCmd := Dashboard(cli.NewFakeContext(&cli.NewFakeContextOption{
    		Namespace: "istio-system",
    	}))
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, strings.Join(c.Args, " ")), func(t *testing.T) {
    			testutil.VerifyOutput(t, dbCmd, c)
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Tue Nov 21 01:17:24 UTC 2023
    - 4.3K bytes
    - Viewed (0)
Back to top