kubernetes/pkg/kubelet/server/server_test.go

const testUID

const testContainerID

const testPodSandboxID

type fakeKubelet

func (fk *fakeKubelet) LatestLoopEntryTime() time.Time {}

func (fk *fakeKubelet) GetPodByName(namespace, name string) (*v1.Pod, bool) {}

func (fk *fakeKubelet) GetRequestedContainersInfo(containerName string, options cadvisorapiv2.RequestOptions) (map[string]*cadvisorapi.ContainerInfo, error) {}

func (fk *fakeKubelet) GetCachedMachineInfo() (*cadvisorapi.MachineInfo, error) {}

func (*fakeKubelet) GetVersionInfo() (*cadvisorapi.VersionInfo, error) {}

func (fk *fakeKubelet) GetPods() []*v1.Pod {}

func (fk *fakeKubelet) GetRunningPods(ctx context.Context) ([]*v1.Pod, error) {}

func (fk *fakeKubelet) ServeLogs(w http.ResponseWriter, req *http.Request) {}

func (fk *fakeKubelet) GetKubeletContainerLogs(ctx context.Context, podFullName, containerName string, logOptions *v1.PodLogOptions, stdout, stderr io.Writer) error {}

func (fk *fakeKubelet) GetHostname() string {}

func (fk *fakeKubelet) RunInContainer(_ context.Context, podFullName string, uid types.UID, containerName string, cmd []string) ([]byte, error) {}

func (fk *fakeKubelet) CheckpointContainer(_ context.Context, podUID types.UID, podFullName, containerName string, options *runtimeapi.CheckpointContainerRequest) error {}

func (fk *fakeKubelet) ListMetricDescriptors(ctx context.Context) ([]*runtimeapi.MetricDescriptor, error) {}

func (fk *fakeKubelet) ListPodSandboxMetrics(ctx context.Context) ([]*runtimeapi.PodSandboxMetrics, error) {}

func (fk *fakeKubelet) SyncLoopHealthCheck(req *http.Request) error {}

type fakeRuntime

func (f *fakeRuntime) Exec(_ context.Context, containerID string, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error {}

func (f *fakeRuntime) Attach(_ context.Context, containerID string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error {}

func (f *fakeRuntime) PortForward(_ context.Context, podSandboxID string, port int32, stream io.ReadWriteCloser) error {}

type testStreamingServer

func newTestStreamingServer(streamIdleTimeout time.Duration) (s *testStreamingServer, err error) {}

func (fk *fakeKubelet) GetExec(_ context.Context, podFullName string, podUID types.UID, containerName string, cmd []string, streamOpts remotecommandserver.Options) (*url.URL, error) {}

func (fk *fakeKubelet) GetAttach(_ context.Context, podFullName string, podUID types.UID, containerName string, streamOpts remotecommandserver.Options) (*url.URL, error) {}

func (fk *fakeKubelet) GetPortForward(ctx context.Context, podName, podNamespace string, podUID types.UID, portForwardOpts portforward.V4Options) (*url.URL, error) {}

// Unused functions
func (*fakeKubelet) GetNode() (*v1.Node, error)                       {}

func (*fakeKubelet) GetNodeConfig() cm.NodeConfig                     {}

func (*fakeKubelet) GetPodCgroupRoot() string                         {}

func (*fakeKubelet) GetPodByCgroupfs(cgroupfs string) (*v1.Pod, bool) {}

func (fk *fakeKubelet) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) {}

func (*fakeKubelet) ListBlockVolumesForPod(podUID types.UID) (map[string]volume.BlockVolume, bool) {}

func (*fakeKubelet) RootFsStats() (*statsapi.FsStats, error)                     {}

func (*fakeKubelet) ListPodStats(_ context.Context) ([]statsapi.PodStats, error) {}

func (*fakeKubelet) ListPodStatsAndUpdateCPUNanoCoreUsage(_ context.Context) ([]statsapi.PodStats, error) {}

func (*fakeKubelet) ListPodCPUAndMemoryStats(_ context.Context) ([]statsapi.PodStats, error) {}

func (*fakeKubelet) ImageFsStats(_ context.Context) (*statsapi.FsStats, *statsapi.FsStats, error) {}

func (*fakeKubelet) RlimitStats() (*statsapi.RlimitStats, error) {}

func (*fakeKubelet) GetCgroupStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, *statsapi.NetworkStats, error) {}

func (*fakeKubelet) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, error) {}

type fakeAuth

func (f *fakeAuth) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error) {}

func (f *fakeAuth) GetRequestAttributes(u user.Info, req *http.Request) []authorizer.Attributes {}

func (f *fakeAuth) Authorize(ctx context.Context, a authorizer.Attributes) (authorized authorizer.Decision, reason string, err error) {}

type serverTestFramework

func newServerTest() *serverTestFramework {}

func newServerTestWithDebug(enableDebugging bool, streamingServer streaming.Server) *serverTestFramework {}

func newServerTestWithDebuggingHandlers(kubeCfg *kubeletconfiginternal.KubeletConfiguration, streamingServer streaming.Server) *serverTestFramework {}

// A helper function to return the correct pod name.
func getPodName(name, namespace string) string {}

func TestServeLogs(t *testing.T) {}

func TestServeRunInContainer(t *testing.T) {}

func TestServeRunInContainerWithUID(t *testing.T) {}

func TestHealthCheck(t *testing.T) {}

func assertHealthFails(t *testing.T, httpURL string, expectedErrorCode int) {}

// Ensure all registered handlers & services have an associated testcase.
func TestAuthzCoverage(t *testing.T) {}

func TestAuthFilters(t *testing.T) {}

func TestAuthenticationError(t *testing.T) {}

func TestAuthenticationFailure(t *testing.T) {}

func TestAuthorizationSuccess(t *testing.T) {}

func TestSyncLoopCheck(t *testing.T) {}

// returns http response status code from the HTTP GET
func assertHealthIsOk(t *testing.T, httpURL string) {}

func setPodByNameFunc(fw *serverTestFramework, namespace, pod, container string) {}

func setGetContainerLogsFunc(fw *serverTestFramework, t *testing.T, expectedPodName, expectedContainerName string, expectedLogOptions *v1.PodLogOptions, output string) {}

func TestContainerLogs(t *testing.T) {}

func TestContainerLogsWithInvalidTail(t *testing.T) {}

func TestCheckpointContainer(t *testing.T) {}

func makeReq(t *testing.T, method, url, clientProtocol string) *http.Request {}

func TestServeExecInContainerIdleTimeout(t *testing.T) {}

func testExecAttach(t *testing.T, verb string) {}

func TestServeExecInContainer(t *testing.T) {}

func TestServeAttachContainer(t *testing.T) {}

func TestServePortForwardIdleTimeout(t *testing.T) {}

func TestServePortForward(t *testing.T) {}

func TestMetricBuckets(t *testing.T) {}

func TestMetricMethodBuckets(t *testing.T) {}

func TestDebuggingDisabledHandlers(t *testing.T) {}

func TestDisablingLogAndProfilingHandler(t *testing.T) {}

func TestFailedParseParamsSummaryHandler(t *testing.T) {}

func verifyEndpointResponse(t *testing.T, fw *serverTestFramework, path string, expectedResponse string) {}

func TestTrimURLPath(t *testing.T) {}

func TestFineGrainedAuthz(t *testing.T) {}

func TestNewServerRegistersMetricsSLIsEndpointTwice(t *testing.T) {}