Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Ginkgo test framework #1733

Merged
merged 1 commit into from Oct 26, 2017
Merged

Tests: Ginkgo test framework #1733

merged 1 commit into from Oct 26, 2017

Conversation

@eloycoto
Copy link
Member

@eloycoto eloycoto commented Oct 10, 2017

Hello!

This PR is still WIP, at the moment all basic test should be in there, but I'll like to add the following test before get it merged:

  • Runtime: Cilium monitor
  • Kubernetes: Node-port

On the other hand, I didn't see any test related with the option -lb and maybe it's needed to add a test for that.

Related with other work to do:

  • At the moment, this Jenkins is not executing the go unittest; I want to speak with Ian before doing something here.
  • The Readme explains how to run the test, but maybe you prefer a Makefile that can have the following:
    make runtime
    make k8s-1.6
    make k8s-1.7
    make k8s-1.8

Please, can you have a look and make your notes/suggestions in this PR?

Regards

log "github.com/sirupsen/logrus"
)

var DefaultSettings map[string]string = map[string]string{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should omit type map[string]string from declaration of var DefaultSettings; it will be inferred from the right-hand side

Loading

"github.com/cilium/cilium/test/helpers"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading


"github.com/cilium/cilium/test/helpers"

. "github.com/onsi/ginkgo"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading


"github.com/cilium/cilium/test/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading

"time"

"github.com/cilium/cilium/test/helpers"
. "github.com/onsi/ginkgo"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading

package k8sT

import (
. "github.com/onsi/ginkgo"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading


"github.com/cilium/cilium/test/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading

"time"

"github.com/cilium/cilium/test/helpers"
. "github.com/onsi/ginkgo"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading

"github.com/cilium/cilium/test/helpers"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading

"github.com/asaskevich/govalidator"
"github.com/cilium/cilium/test/helpers"

. "github.com/onsi/ginkgo"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use dot imports

Loading

return result, nil
}

//KVOutput: This is a helper functon that return a map with the key=val output.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported method CmdRes.KVOutput should be of the form "KVOutput ..."

Loading

return strings.Trim(res.stdout.String(), "\n")
}

func (res *CmdRes) FindResults(filter string) ([]reflect.Value, error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method CmdRes.FindResults should have comment or be unexported

Loading

exit bool
}

//Correct: return true if the command was sucessfull

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported method CmdRes.Correct should be of the form "Correct ..."

Loading

"k8s.io/client-go/util/jsonpath"
)

type CmdRes struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type CmdRes should have comment or be unexported

Loading

return result, nil
}

//KVOutput: This is a helper functon that return a map with the key=val output.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported method CmdRes.KVOutput should be of the form "KVOutput ..."

Loading

return strings.Trim(res.stdout.String(), "\n")
}

func (res *CmdRes) FindResults(filter string) ([]reflect.Value, error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method CmdRes.FindResults should have comment or be unexported

Loading

exit bool
}

//Correct: return true if the command was sucessfull

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported method CmdRes.Correct should be of the form "Correct ..."

Loading

"k8s.io/client-go/util/jsonpath"
)

type CmdRes struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type CmdRes should have comment or be unexported

Loading

"github.com/cilium/cilium/test/helpers"
)

//GetScope: return scope for running test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported function GetScope should be of the form "GetScope ..."

Loading

return addTestType(text, body, "IT", afterAll, timeout...)
}

//You can focus individual Its using FIt. this contains AfterAll wrapper

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported function FIt should be of the form "FIt ..."

Loading

return ginkgoFunc(text, wrappedBody, timeout...)
}

//Text block with AfterAll wrapper

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported function It should be of the form "It ..."

Loading

"github.com/onsi/ginkgo"
)

type AfterAll struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type AfterAll should have comment or be unexported

Loading

@eloycoto eloycoto force-pushed the ginkgo branch 2 times, most recently from e809277 to fdbe0c2 Oct 10, 2017
@nebril nebril added the wip label Oct 10, 2017
@ianvernon
Copy link
Member

@ianvernon ianvernon commented Oct 10, 2017

I cannot tell you how excited I am for this! My review is WIP - given the size of this, it will take a while.
To avoid with the review process, can you provide comments that describe which parts of the tests that currently exist in master map to the new gingko tests so that we can ensure that the tests correspond 1:1 with what we have in the current bash testing framework? This will help significantly with ensuring that no coverage is lost in the transition to the new framework.

Loading

@eloycoto
Copy link
Member Author

@eloycoto eloycoto commented Oct 10, 2017

Hello!

A bunch of test are duplicated, I made the list on the issue #1589 where I map all the test to there. So if that it's not clear to you I can map 1:1 with the bash test.

Regards

Loading

@eloycoto eloycoto force-pushed the ginkgo branch 3 times, most recently from 73f7778 to 994e204 Oct 11, 2017
@@ -0,0 +1,209 @@
package k8sT
Copy link
Member

@nebril nebril Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this package be called in a more descriptive way? Like k8sTests?

Loading

@@ -0,0 +1,652 @@
package RunT
Copy link
Member

@nebril nebril Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have this named "RuntimeTests"

Loading

Expect(res.Correct()).Should(BeTrue())
})

It("Default values", func() {
Copy link
Member

@nebril nebril Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: "It Default values" doesn't really give much information. What about It("should disable policy enforcement with defauklt values")? It can be done later as I understand that this is direct conversion from bash scripts.

Loading

Copy link
Member

@joestringer joestringer left a comment

I noted a few minor issues here from an initial scan through.

Loading

ciliumPod, err := kubectl.GetCiliumPodOnNode("kube-system", "k8s1")
Expect(err).Should(BeNil())

//Check that cilium detects a
Copy link
Member

@joestringer joestringer Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete comment? Also below.

Loading

if [[ "$(hostname)" == "k8s1" ]]; then
make docker-image-dev
docker tag cilium 192.168.36.11:5000/cilium/cilium-dev
docker push 192.168.36.11:5000/cilium/cilium-dev
Copy link
Member

@joestringer joestringer Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we refactor these hard-coded IPs to a single place?

There's a few more of these, I won't highlight every one.

Loading

Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that these are used in k8s manifests as docker registry addresses. Could we put this ip into vm /etc/hosts and use hostname in k8s manifests?

Loading

Expect(res.Correct()).Should(BeTrue())
}, 300)

It("Test containers connectivity WITH policy", func() {
Copy link
Member

@joestringer joestringer Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could share some of the common test code between this and Test containers connectivity without policy?

Loading

@@ -1,3 +1,3 @@
PATH=/usr/lib/llvm-3.8/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
CILIUM_OPTS=--kvstore consul --kvstore-opt consul.address=127.0.0.1:8500
CILIUM_OPTS=--kvstore consul --kvstore-opt consul.address=127.0.0.1:8500 --debug
Copy link
Member

@joestringer joestringer Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this affect all deployments, or just in the testing? Not sure if this is unrelated change that should be kept out.

Loading

Copy link
Member Author

@eloycoto eloycoto Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault! I'll remove it ;-)

Loading

Copy link
Member

@nebril nebril left a comment

Overall looks like a great job! Left some questions and suggestions inline.

Loading

log "github.com/sirupsen/logrus"
)

var _ = Describe("RunConnectivyTest", func() {
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Connectivy/Connectivity

Loading

Jenkinsfile Outdated
sh './tests/k8s/start.sh'
}
"Runtime":{
sh 'cd ${TESTDIR}; ginkgo --focus="Run*" -v -noColor'
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we change runtime test name convention from Run<test name> to Runtime<test name>?

Loading

Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to get coverage results of the Cilium commands using ginkgo -cover ? Or is that not possible since we are running cilium commands via its CLI and are not actually testing Cilium code directly with Ginkgo?

Loading

)

var _ = Describe("K8s", func() {
// Describe("Categorizing book length", func() {
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to keep this example? There are plenty of tests to check for examples, I would like this file gone. If we really want it to stay, I think it should be uncommented.

Loading

if [[ "$(hostname)" == "k8s1" ]]; then
make docker-image-dev
docker tag cilium 192.168.36.11:5000/cilium/cilium-dev
docker push 192.168.36.11:5000/cilium/cilium-dev
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that these are used in k8s manifests as docker registry addresses. Could we put this ip into vm /etc/hosts and use hostname in k8s manifests?

Loading

@@ -0,0 +1,116 @@
# Cilium Test Suite
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a part of Documentation/contributing.rst?

Loading

killCmd := "sudo kill -9 $(pgrep cilium-agent)"
go docker.Node.Exec(cmd)
timeout := time.After(300 * time.Second)
for {
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both select cases are returning from the func, so for is not needed here.

Loading

}

done := make(chan string, 1)
agent := func(option string) {
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the agent accept done channel as an argument so that each test is separated. Otherwise ending of one test may cause the first one to kill node from other test.

Loading

DisableTimestamp: true,
})

// var filename string = "test.log"
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented out code.

Loading

var vagrant helpers.Vagrant

func init() {
// log.SetOutput(os.Stdout)
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented out code.

Loading

@@ -0,0 +1,7 @@
package ciliumTest
Copy link
Member

@nebril nebril Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this package?

Loading

Copy link
Member

@ianvernon ianvernon left a comment

These are some initial comments from what I have reviewed thus far. Given the magnitude of this patch, I didn't want to wait until I was completely done with review to provide initial comments so that the work on what I have suggested can be done in parallel with my upcoming review of what I haven't looked at yet.

Loading

Jenkinsfile Outdated
junit 'test/*.xml'
sh 'cd test/; vagrant destroy -f'
sh 'cd test/; K8S_VERSION=1.6; vagrant destroy -f'
}
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need cleanup for K8s 1.7 VMs

Loading

Jenkinsfile Outdated
sh 'cd ./tests/k8s && vagrant destroy -f || true'
sh './tests/k8s/start.sh'
}
"Runtime":{
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add unit tests stage as we discussed. We will need to install Docker on the Jenkins hosts to run the unit tests in a Docker container.

Loading

Jenkinsfile Outdated
sh 'cd ./tests/k8s && vagrant destroy -f'
post {
always {
junit 'test/*.xml'
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should still be gathering logs from our tests as was done before on lines 34-37, as we need as many datapoints to debug failures as possible.

Loading

test/Vagrantfile Outdated
# -*- mode: ruby -*-
# vi: set ft=ruby :

$build_number = ENV['BUILD_NUMBER'] || "0"
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need more differentiation in build number per VM. Example: say if we have two builds running with the same value for BUILD_NUMBER on the Jenkins slave - there will be interactions that we are unsure of. Is there a limitation in the existing VM that is launched with cilium/Vagrantfile that made you need to use this VM instead? It's ideal to keep the # of VMs that we have to manage to a minimum.

Loading

Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @aanm regarding this new Vagrantfile. What are your thoughts?

Loading

Copy link
Member Author

@eloycoto eloycoto Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,

Thanks for the review, a lot of work to do, thanks! :-)

Not sure if I understand this, the network part is different per each K8S_VERSION:

            server.vm.network "private_network",
                ip: "192.168.36.1#{i}",
                virtualbox__intnet: "cilium-k8s#{$build_number}-#{$K8S_VERSION}"

Loading

Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see cilium/Vagrantfile:L72-82:

# Create unique ID for use in vboxnet name so Jenkins pipeline can have concurrent builds.
$job_name = ENV['JOB_BASE_NAME'] || "local"

$build_number = ENV['BUILD_NUMBER'] || "0"
$build_id = "#{$job_name}-#{$build_number}"

# Only create the build_id_name for Jenkins environment so that
# we can run VMs locally without having any the `build_id` in the name.
if ENV['BUILD_NUMBER'] then
    $build_id_name = "-build-#{$build_id}"
end

If there are two jobs running concurrently on the same Jenkins slave for PR 1 and PR 2, each with BUILD_NUMBER=1 , then both will be part of the same virtualbox__intnetwhich we don't want. We need to have the JOB_BASE_NAME to differentiate between Jenkins jobs that might be using the same BUILD_NUMBER .

Loading

test/Vagrantfile Outdated
server.vm.provision "shell" do |sh|
sh.path = "./provision/k8s_install.sh"
sh.args = ["k8s#{i}", "192.168.36.1#{i}", "#{$K8S_version}"]
end
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is inconsistent here.

Loading

return fmt.Sprintf("%s/runtime/manifests/", basePath)
}

//GetFullPath return the valid path for a file
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returns

Loading

return fmt.Sprintf("%s%s", c.ManifestsPath(), name)
}

//PolicyEndpointsSummary Return a map of the status of the policies
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returns the count of whether policy enforcement is enabled, disabled, and the total number of endpoints, and an error if the Cilium endpoint metadata cannot be retrieved via the API.

Loading

return result, nil
}

//PolicyEnforcementSet set policyEnforcement in endpoint
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sets the PolicyEnforcement configuration value for the Cilium agent to the provided status.

Loading

return res
}

//PolicyDel delete a given policy
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deletes a policy with the given ID

Loading

return rev.IntOutput()
}

//PolicyImport Import a new policy in cilium and wait until all endpoints
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports a new policy into Cilium and waits until the policy revision number increments.

Loading

Copy link
Member

@ianvernon ianvernon left a comment

more comments

Loading

func addTestType(text string, body func(), testType string, control *AfterAll, timeout ...float64) bool {
var ginkgoFunc func(text string, body interface{}, timeout ...float64) bool

//FIXME: XIT functions
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? If this is something that can be fixed after this initial patch is merged as an enhancement, please create a follow-up GitHub issue, refer to this PR / its corresponding issue, and add GH- in this FIXME comment so we can be sure that we have an issue tracking this FIXME.

Loading

var data []models.Endpoint
err := c.Exec(fmt.Sprintf("endpoint get %s", id)).UnMarshal(&data)
if err != nil {
c.logCxt.Infof("EndpointsGet fail %d: %s", id, err)
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to update this log message when you rename the function (EndpointsGet --> EndpointGet).

Loading

Jenkinsfile Outdated
sh './tests/k8s/start.sh'
}
"Runtime":{
sh 'cd ${TESTDIR}; ginkgo --focus="Run*" -v -noColor'
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to get coverage results of the Cilium commands using ginkgo -cover ? Or is that not possible since we are running cilium commands via its CLI and are not actually testing Cilium code directly with Ginkgo?

Loading

test/Vagrantfile Outdated
# -*- mode: ruby -*-
# vi: set ft=ruby :

$build_number = ENV['BUILD_NUMBER'] || "0"
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @aanm regarding this new Vagrantfile. What are your thoughts?

Loading

"github.com/onsi/ginkgo"
)

//AfterAll struct to run after all process finish
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would change to "AfterAll is a structure whose Body is called after all processes finish".
What is the scope of these processes? I.e., are these called after the suite is finished, after a test is finished, etc. - please clarify in the description / comment.

Loading

@@ -0,0 +1,69 @@
package k8sT
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header

Loading

@@ -0,0 +1,119 @@
package k8sT
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header

Loading

ciliumPod, err := kubectl.GetCiliumPodOnNode("kube-system", "k8s1")
Expect(err).Should(BeNil())

//Check that cilium detects a
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete comment

Loading

@@ -0,0 +1,17 @@
package k8sT
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header if this file is going to be kept. I think this can be deleted.

Loading

docker tag cilium 192.168.36.11:5000/cilium/cilium-dev
docker push 192.168.36.11:5000/cilium/cilium-dev
else
echo "No master, no need to compile"
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log is not clear; change to not on master K8s node; no need to compile Cilium

Loading

@ianvernon ianvernon requested a review from aanm Oct 16, 2017
Copy link
Member

@ianvernon ianvernon left a comment

more comments. I still need to review the tests' content to ensure that they cover what currently exists in in the bash scripts.

Loading

key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
value: "true"
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this many DaemonSet files to maintain will be very difficult for us, as we have to update examples/minikube, examples/kubernetes, etc. Is there a way we can just use the files located in examples/ directory instead of duplicating them here?

Loading

Expect(endPoints["disabled"]).To(Equal(1))
})

By("Apply a new policy")
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specify the path of the policy

Loading

@@ -0,0 +1,652 @@
package RunT
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header

Loading


var _ = Describe("RunPolicies", func() {

var initilized bool
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initilized --> initialized

Loading

var docker *helpers.Docker
var cilium *helpers.Cilium

initilize := func() {
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initilize --> initialize

Loading

}, 500)

It("Service L4 tests", func() {
// createInterface(docker.Node)
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this if it is not being used.

Loading

}
path := "/vagrant/create_veth_interface"
node.Exec("sudo ip addr add fd02:1:1:1:1:1:1:1 dev cilium_host")
//FIXME: Here we need to check if executes correctly
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error needs to be handled before this patch is merged.

Loading

@@ -0,0 +1,43 @@
[
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rename these policy files to correspond to the test in which they are used ?
e.g., Policies-l7-simple.json

Loading

@@ -0,0 +1,7 @@
package ciliumTest
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header

Loading

@@ -0,0 +1,90 @@
package ciliumTest
Copy link
Member

@ianvernon ianvernon Oct 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add copyright header

Loading