Skip to content

Commit

Permalink
add e2e for http
Browse files Browse the repository at this point in the history
Signed-off-by: ii2day <ji.li@daocloud.io>
  • Loading branch information
ii2day committed Jun 26, 2023
1 parent d606747 commit 11daec2
Show file tree
Hide file tree
Showing 12 changed files with 1,160 additions and 46 deletions.
1 change: 1 addition & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ deploy_project:
HELM_OPTION+=" --set kdoctorAgent.ingress.enable=false " ; \
fi ; \
HELM_OPTION+=" --set feature.aggregateReport.enabled=true " ; \
HELM_OPTION+=" --set feature.nethttp_defaultConcurrency=10 " ; \
HELM_OPTION+=" --set feature.aggregateReport.controller.reportHostPath=/var/run/kdoctor/controller " ; \
HELM_OPTION+=" --set kdoctorAgent.debug.logLevel=debug --set kdoctorController.debug.logLevel=debug " ; \
HELM_OPTION+=" --set kdoctorAgent.prometheus.enabled=true --set kdoctorController.prometheus.enabled=true " ; \
Expand Down
17 changes: 17 additions & 0 deletions test/docs/AppHttpHealth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# E2E Cases for AppHttpHealth

| Case ID | Title | Priority | Smoke | Status | Other |
|---------|-----------------------------------------------------------------------------|----------|-------|--------|-------------|
| A00001 | Successfully http testing appHttpHealth method GET case | p1 | | done | |
| A00002 | Failed http testing appHttpHealth due to status code case | p1 | | done | |
| A00003 | Failed http testing appHttpHealth due to delay case | p1 | | done | |
| A00004 | Successfully https testing appHttpHealth method GET case | p1 | | done | |
| A00005 | Failed https testing appHttpHealth due to tls case | p1 | | done | |
| A00006 | Successfully http testing appHttpHealth method PUT case | p1 | | done | |
| A00007 | Successfully http testing appHttpHealth method POST With Body case | p1 | | done | |
| A00008 | Successfully http testing appHttpHealth method HEAD case | p1 | | done | |
| A00009 | Successfully http testing appHttpHealth method PATCH case | p1 | | done | |
| A000010 | Successfully http testing appHttpHealth method OPTIONS case | p1 | | done | |
| A000011 | After QPS is specified, the number of requests meets the requirements case | p1 | | done | |
| A000012 | Successfully http testing appHttpHealth due to success rate case | p1 | | done | |
| A000013 | Successfully https testing appHttpHealth method GET Protocol Http2 case | p1 | | done | |
8 changes: 8 additions & 0 deletions test/docs/NetReach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# E2E Cases for IP NetReach

| Case ID | Title | Priority | Smoke | Status | Other |
|--------|-------------------------------------------------------------|----------|-------|--------|-------------|
| B00001 | Successfully dual testing netReach case | p1 | | done | |
| B00002 | Successfully ipv4 testing netReach case | p1 | | done | |
| B00003 | Successfully ipv6 testing netReach case | p1 | | done | |

9 changes: 9 additions & 0 deletions test/docs/schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# E2E Cases for IP schedule

| Case ID | Title | Priority | Smoke | Status | Other |
|---------|-------------------------------------------------|----------|-------|--------|-------------|
| C00001 | Successfully testing NetReach crontab case | p1 | | done | |
| C00002 | Successfully testing AppHttpHealth crontab case | p1 | | done | |
| C00003 | Successfully testing NetReach sample case | p1 | | done | |
| C00004 | Successfully testing AppHttpHealth sample case | p1 | | done | |

49 changes: 49 additions & 0 deletions test/e2e/apphttphealth/apphttphealth_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2023 Authors of kdoctor-io
// SPDX-License-Identifier: Apache-2.0

package apphttphealth_test

import (
kdoctor_v1beta1 "github.com/kdoctor-io/kdoctor/pkg/k8s/apis/kdoctor.io/v1beta1"
"github.com/kdoctor-io/kdoctor/test/e2e/common"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
e2e "github.com/spidernet-io/e2eframework/framework"
"k8s.io/apimachinery/pkg/runtime"
"testing"
)

func TestNetReach(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "AppHttpHealth Suite")
}

var frame *e2e.Framework
var testSvcIP string
var testPodIPs = make([]string, 0)
var httpPort = 80
var httpsPort = 443

var _ = BeforeSuite(func() {
defer GinkgoRecover()
var e error
frame, e = e2e.NewFramework(GinkgoT(), []func(*runtime.Scheme) error{kdoctor_v1beta1.AddToScheme})
Expect(e).NotTo(HaveOccurred())

testSvc, e := frame.GetService(common.KDoctorTestSVCName, common.KDoctorTestDSNamespace)
Expect(e).NotTo(HaveOccurred(), "get kdoctor test service")
testSvcIP = testSvc.Spec.ClusterIP
GinkgoWriter.Println("get test service ip %v", testSvcIP)

testDS, e := frame.GetDaemonSet(common.KDoctorAgentDSName, common.KDoctorAgentNS)
Expect(e).NotTo(HaveOccurred(), "get kdoctor test daemonset")

testPods, e := frame.GetDaemonSetPodList(testDS)
Expect(e).NotTo(HaveOccurred(), "get kdoctor test pod list")

for _, v := range testPods.Items {
testPodIPs = append(testPodIPs, v.Status.PodIP)
}
GinkgoWriter.Println("get test pod ips %v", testPodIPs)

})
Loading

0 comments on commit 11daec2

Please sign in to comment.