From a9eec3ca7bea7ecfcf4168a12cc63f00f7b57176 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 11 Aug 2020 13:06:50 -0700 Subject: [PATCH 1/6] add unit test for daemon info --- pkg/drivers/kic/oci/info.go | 38 ++++++---- pkg/drivers/kic/oci/info_test.go | 126 +++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+), 13 deletions(-) create mode 100644 pkg/drivers/kic/oci/info_test.go diff --git a/pkg/drivers/kic/oci/info.go b/pkg/drivers/kic/oci/info.go index e939032056..d5b9623e1c 100644 --- a/pkg/drivers/kic/oci/info.go +++ b/pkg/drivers/kic/oci/info.go @@ -46,13 +46,13 @@ func CachedDaemonInfo(ociBin string) (SysInfo, error) { } // DaemonInfo returns common docker/podman daemon system info that minikube cares about -func DaemonInfo(ociBin string) (SysInfo, error) { +func DaemonInfo(ociBin string, mockTest ...string) (SysInfo, error) { if ociBin == Podman { - p, err := podmanSystemInfo() + p, err := podmanSystemInfo(mockTest...) cachedSysInfo = &SysInfo{CPUs: p.Host.Cpus, TotalMemory: p.Host.MemTotal, OSType: p.Host.Os} return *cachedSysInfo, err } - d, err := dockerSystemInfo() + d, err := dockerSystemInfo(mockTest...) cachedSysInfo = &SysInfo{CPUs: d.NCPU, TotalMemory: d.MemTotal, OSType: d.OSType} return *cachedSysInfo, err } @@ -225,14 +225,20 @@ type podmanSysInfo struct { } // dockerSystemInfo returns docker system info --format '{{json .}}' -func dockerSystemInfo() (dockerSysInfo, error) { +func dockerSystemInfo(mockTest ...string) (dockerSysInfo, error) { var ds dockerSysInfo - rr, err := runCmd(exec.Command(Docker, "system", "info", "--format", "{{json .}}")) - if err != nil { - return ds, errors.Wrap(err, "get docker system info") + var rawJson string + if len(mockTest) > 0 { + rawJson = mockTest[0] + } else { + rr, err := runCmd(exec.Command(Docker, "system", "info", "--format", "{{json .}}")) + if err != nil { + return ds, errors.Wrap(err, "get docker system info") + } + rawJson = rr.Stdout.String() } - if err := json.Unmarshal([]byte(strings.TrimSpace(rr.Stdout.String())), &ds); err != nil { + if err := json.Unmarshal([]byte(strings.TrimSpace(rawJson)), &ds); err != nil { return ds, errors.Wrapf(err, "unmarshal docker system info") } @@ -240,14 +246,20 @@ func dockerSystemInfo() (dockerSysInfo, error) { } // podmanSysInfo returns podman system info --format '{{json .}}' -func podmanSystemInfo() (podmanSysInfo, error) { +func podmanSystemInfo(mockTest ...string) (podmanSysInfo, error) { var ps podmanSysInfo - rr, err := runCmd(exec.Command(Podman, "system", "info", "--format", "json")) - if err != nil { - return ps, errors.Wrap(err, "get podman system info") + var rawJson string + if len(mockTest) > 0 { + rawJson = mockTest[0] + } else { + rr, err := runCmd(exec.Command(Podman, "system", "info", "--format", "json")) + if err != nil { + return ps, errors.Wrap(err, "get podman system info") + } + rawJson = rr.Stdout.String() } - if err := json.Unmarshal([]byte(strings.TrimSpace(rr.Stdout.String())), &ps); err != nil { + if err := json.Unmarshal([]byte(strings.TrimSpace(rawJson)), &ps); err != nil { return ps, errors.Wrapf(err, "unmarshal podman system info") } return ps, nil diff --git a/pkg/drivers/kic/oci/info_test.go b/pkg/drivers/kic/oci/info_test.go new file mode 100644 index 0000000000..0f2974954e --- /dev/null +++ b/pkg/drivers/kic/oci/info_test.go @@ -0,0 +1,126 @@ +package oci + +import "testing" + +func TestDockerSystemInfo(t *testing.T) { + testCases := []struct { + Name string // test case bane + OciBin string // Docker or Podman + RawJSON string // raw response from json + ShouldError bool + CPUs int + Memory int64 + OS string + }{ + { + Name: "linux_docker", + OciBin: "docker", + RawJSON: `{"ID":"7PYP:53DU:MLWX:EDQG:YG2Y:UJLB:J7SD:4SAI:XF2Y:N2MR:MU53:DR3N","Containers":3,"ContainersRunning":1,"ContainersPaused":0,"ContainersStopped":2,"Images":76,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Native Overlay Diff","true"]],"SystemStatus":null,"Plugins":{"Volume":["local"],"Network":["bridge","host","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","local","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":false,"KernelMemory":true,"KernelMemoryTCP":false,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":false,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":false,"NFd":27,"OomKillDisable":true,"NGoroutines":48,"SystemTime":"2020-08-11T18:16:17.494440681Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":0,"KernelVersion":"4.9.0-8-amd64","OperatingSystem":"Debian GNU/Linux 9 (stretch)","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":[],"AllowNondistributableArtifactsHostnames":[],"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":[],"Secure":true,"Official":true}},"Mirrors":[]},"NCPU":16,"MemTotal":63336071168,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"image-builder-cloud-shell-v20200811-102837","Labels":[],"ExperimentalBuild":false,"ServerVersion":"18.09.0","ClusterStore":"","ClusterAdvertise":"","Runtimes":{"runc":{"path":"runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"7ad184331fa3e55e52b890ea95e65ba581ae3429","Expected":"7ad184331fa3e55e52b890ea95e65ba581ae3429"},"RuncCommit":{"ID":"dc9208a3303feef5b3839f4323d9beb36df0a9dd","Expected":"dc9208a3303feef5b3839f4323d9beb36df0a9dd"},"InitCommit":{"ID":"fec3683","Expected":"fec3683"},"SecurityOptions":["name=seccomp,profile=default"],"ProductLicense":"Community Engine","Warnings":["WARNING: No swap limit support"],"ClientInfo":{"Debug":false,"Plugins":[],"Warnings":null}}`, + ShouldError: false, + CPUs: 16, + Memory: 63336071168, + OS: "linux", + }, + { + Name: "macos_docker", + OciBin: "docker", + RawJSON: `{"ID":"T54Z:I56K:XRG5:BTMK:BI72:IMI3:QBBF:H2PD:DGAF:EQLJ:7JFZ:PF54","Containers":5,"ContainersRunning":1,"ContainersPaused":0,"ContainersStopped":4,"Images":84,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Native Overlay Diff","true"]],"SystemStatus":null,"Plugins":{"Volume":["local"],"Network":["bridge","host","ipvlan","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","local","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"KernelMemoryTCP":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":true,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":46,"OomKillDisable":true,"NGoroutines":56,"SystemTime":"2020-08-11T19:33:23.8936297Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":3,"KernelVersion":"4.19.76-linuxkit","OperatingSystem":"Docker Desktop","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":[],"AllowNondistributableArtifactsHostnames":[],"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":[],"Secure":true,"Official":true}},"Mirrors":[]},"NCPU":4,"MemTotal":3142250496,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"gateway.docker.internal:3128","HttpsProxy":"gateway.docker.internal:3129","NoProxy":"","Name":"docker-desktop","Labels":[],"ExperimentalBuild":false,"ServerVersion":"19.03.12","ClusterStore":"","ClusterAdvertise":"","Runtimes":{"runc":{"path":"runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"7ad184331fa3e55e52b890ea95e65ba581ae3429","Expected":"7ad184331fa3e55e52b890ea95e65ba581ae3429"},"RuncCommit":{"ID":"dc9208a3303feef5b3839f4323d9beb36df0a9dd","Expected":"dc9208a3303feef5b3839f4323d9beb36df0a9dd"},"InitCommit":{"ID":"fec3683","Expected":"fec3683"},"SecurityOptions":["name=seccomp,profile=default"],"ProductLicense":"Community Engine","Warnings":null,"ClientInfo":{"Debug":false,"Plugins":[],"Warnings":null}} +`, + ShouldError: false, + CPUs: 4, + Memory: 3142250496, + OS: "linux", + }, + { + Name: "windows_docker", + OciBin: "docker", + RawJSON: `{"ID":"CVVH:7ZIB:S5EO:L6VO:MGZ3:TRLS:JGIS:4ZI2:27Z7:MQAQ:YSLT:HEHB","Containers":0,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":0,"Images":3,"Driver":"overlay2","DriverStatus":[["Backing Filesystem","extfs"],["Supports d_type","true"],["Native Overlay Diff","true"]],"SystemStatus":null,"Plugins":{"Volume":["local"],"Network":["bridge","host","ipvlan","macvlan","null","overlay"],"Authorization":null,"Log":["awslogs","fluentd","gcplogs","gelf","journald","json-file","local","logentries","splunk","syslog"]},"MemoryLimit":true,"SwapLimit":true,"KernelMemory":true,"KernelMemoryTCP":true,"CpuCfsPeriod":true,"CpuCfsQuota":true,"CPUShares":true,"CPUSet":true,"PidsLimit":true,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"Debug":true,"NFd":35,"OomKillDisable":true,"NGoroutines":45,"SystemTime":"2020-08-11T19:39:26.083212722Z","LoggingDriver":"json-file","CgroupDriver":"cgroupfs","NEventsListener":1,"KernelVersion":"4.19.76-linuxkit","OperatingSystem":"Docker Desktop","OSType":"linux","Architecture":"x86_64","IndexServerAddress":"https://index.docker.io/v1/","RegistryConfig":{"AllowNondistributableArtifactsCIDRs":[],"AllowNondistributableArtifactsHostnames":[],"InsecureRegistryCIDRs":["127.0.0.0/8"],"IndexConfigs":{"docker.io":{"Name":"docker.io","Mirrors":[],"Secure":true,"Official":true}},"Mirrors":[]},"NCPU":4,"MemTotal":10454695936,"GenericResources":null,"DockerRootDir":"/var/lib/docker","HttpProxy":"","HttpsProxy":"","NoProxy":"","Name":"docker-desktop","Labels":[],"ExperimentalBuild":false,"ServerVersion":"19.03.12","ClusterStore":"","ClusterAdvertise":"","Runtimes":{"runc":{"path":"runc"}},"DefaultRuntime":"runc","Swarm":{"NodeID":"","NodeAddr":"","LocalNodeState":"inactive","ControlAvailable":false,"Error":"","RemoteManagers":null},"LiveRestoreEnabled":false,"Isolation":"","InitBinary":"docker-init","ContainerdCommit":{"ID":"7ad184331fa3e55e52b890ea95e65ba581ae3429","Expected":"7ad184331fa3e55e52b890ea95e65ba581ae3429"},"RuncCommit":{"ID":"dc9208a3303feef5b3839f4323d9beb36df0a9dd","Expected":"dc9208a3303feef5b3839f4323d9beb36df0a9dd"},"InitCommit":{"ID":"fec3683","Expected":"fec3683"},"SecurityOptions":["name=seccomp,profile=default"],"ProductLicense":"Community Engine","Warnings":null,"ClientInfo":{"Debug":false,"Plugins":[],"Warnings":null}} +`, + ShouldError: false, + CPUs: 4, + Memory: 10454695936, + OS: "linux", + }, { + Name: "podman_1.8_linux", + OciBin: "podman", + RawJSON: `{ + "host": { + "BuildahVersion": "1.13.1", + "CgroupVersion": "v1", + "Conmon": { + "package": "conmon: /usr/libexec/podman/conmon", + "path": "/usr/libexec/podman/conmon", + "version": "conmon version 2.0.10, commit: unknown" + }, + "Distribution": { + "distribution": "debian", + "version": "10" + }, + "MemFree": 4907147264, + "MemTotal": 7839653888, + "OCIRuntime": { + "name": "runc", + "package": "runc: /usr/sbin/runc", + "path": "/usr/sbin/runc", + "version": "runc version 1.0.0~rc6+dfsg1\ncommit: 1.0.0~rc6+dfsg1-3 spec: 1.0.1" + }, + "SwapFree": 0, + "SwapTotal": 0, + "arch": "amd64", + "cpus": 2, + "eventlogger": "journald", + "hostname": "podman-exp-temp", + "kernel": "4.19.0-8-cloud-amd64", + "os": "linux", + "rootless": false, + "uptime": "2690h 47m 23.31s (Approximately 112.08 days)" + }, + "registries": { + "search": [ + "docker.io", + "quay.io" + ] + }, + "store": { + "ConfigFile": "/etc/containers/storage.conf", + "ContainerStore": { + "number": 1 + }, + "GraphDriverName": "overlay", + "GraphOptions": {}, + "GraphRoot": "/var/lib/containers/storage", + "GraphStatus": { + "Backing Filesystem": "extfs", + "Native Overlay Diff": "true", + "Supports d_type": "true", + "Using metacopy": "false" + }, + "ImageStore": { + "number": 2 + }, + "RunRoot": "/var/run/containers/storage", + "VolumePath": "/var/lib/containers/storage/volumes" + } + } +`, CPUs: 2, + Memory: 7839653888, + OS: "linux"}, + } + + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + s, err := DaemonInfo(tc.OciBin, tc.RawJSON) + if err != nil && !tc.ShouldError { + t.Errorf("Expected not to have error but got %v", err) + } + if s.CPUs != tc.CPUs { + t.Errorf("Expected CPUs to be %d but got %d", tc.CPUs, s.CPUs) + } + if s.TotalMemory != tc.Memory { + t.Errorf("Expected Memory to be %d but got %d", tc.Memory, s.TotalMemory) + } + + }) + + } +} From 4c0334d91f3372567f45fb107c34816e30b8656f Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 11 Aug 2020 13:10:17 -0700 Subject: [PATCH 2/6] add one more case --- pkg/drivers/kic/oci/info_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/drivers/kic/oci/info_test.go b/pkg/drivers/kic/oci/info_test.go index 0f2974954e..bbeffe9265 100644 --- a/pkg/drivers/kic/oci/info_test.go +++ b/pkg/drivers/kic/oci/info_test.go @@ -119,6 +119,9 @@ func TestDockerSystemInfo(t *testing.T) { if s.TotalMemory != tc.Memory { t.Errorf("Expected Memory to be %d but got %d", tc.Memory, s.TotalMemory) } + if s.OSType != tc.OS { + t.Errorf("Expected OS type to be %q but got %q", tc.OS, s.OSType) + } }) From f8d932e697eeff1fb9611d7c2660749d47f41724 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 11 Aug 2020 14:55:30 -0700 Subject: [PATCH 3/6] use mock funcs --- pkg/drivers/kic/oci/info.go | 49 +++++++++++++++----------------- pkg/drivers/kic/oci/info_test.go | 16 +++++++++-- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/pkg/drivers/kic/oci/info.go b/pkg/drivers/kic/oci/info.go index d5b9623e1c..ef48b9209e 100644 --- a/pkg/drivers/kic/oci/info.go +++ b/pkg/drivers/kic/oci/info.go @@ -46,13 +46,13 @@ func CachedDaemonInfo(ociBin string) (SysInfo, error) { } // DaemonInfo returns common docker/podman daemon system info that minikube cares about -func DaemonInfo(ociBin string, mockTest ...string) (SysInfo, error) { +func DaemonInfo(ociBin string) (SysInfo, error) { if ociBin == Podman { - p, err := podmanSystemInfo(mockTest...) + p, err := podmanSystemInfo() cachedSysInfo = &SysInfo{CPUs: p.Host.Cpus, TotalMemory: p.Host.MemTotal, OSType: p.Host.Os} return *cachedSysInfo, err } - d, err := dockerSystemInfo(mockTest...) + d, err := dockerSystemInfo() cachedSysInfo = &SysInfo{CPUs: d.NCPU, TotalMemory: d.MemTotal, OSType: d.OSType} return *cachedSysInfo, err } @@ -224,20 +224,18 @@ type podmanSysInfo struct { } `json:"store"` } -// dockerSystemInfo returns docker system info --format '{{json .}}' -func dockerSystemInfo(mockTest ...string) (dockerSysInfo, error) { - var ds dockerSysInfo - var rawJson string - if len(mockTest) > 0 { - rawJson = mockTest[0] - } else { - rr, err := runCmd(exec.Command(Docker, "system", "info", "--format", "{{json .}}")) - if err != nil { - return ds, errors.Wrap(err, "get docker system info") - } - rawJson = rr.Stdout.String() - } +var dockerInfoGetter = func() (string, error) { + rr, err := runCmd(exec.Command(Docker, "system", "info", "--format", "{{json .}}")) + return rr.Stdout.String(), err +} +// dockerSystemInfo returns docker system info --format '{{json .}}' +func dockerSystemInfo() (dockerSysInfo, error) { + var ds dockerSysInfo + rawJson, err := dockerInfoGetter() + if err != nil { + return ds, errors.Wrap(err, "docker system info") + } if err := json.Unmarshal([]byte(strings.TrimSpace(rawJson)), &ds); err != nil { return ds, errors.Wrapf(err, "unmarshal docker system info") } @@ -245,18 +243,17 @@ func dockerSystemInfo(mockTest ...string) (dockerSysInfo, error) { return ds, nil } +var podmanInfoGetter = func() (string, error) { + rr, err := runCmd(exec.Command(Podman, "system", "info", "--format", "json")) + return rr.Stdout.String(), err +} + // podmanSysInfo returns podman system info --format '{{json .}}' -func podmanSystemInfo(mockTest ...string) (podmanSysInfo, error) { +func podmanSystemInfo() (podmanSysInfo, error) { var ps podmanSysInfo - var rawJson string - if len(mockTest) > 0 { - rawJson = mockTest[0] - } else { - rr, err := runCmd(exec.Command(Podman, "system", "info", "--format", "json")) - if err != nil { - return ps, errors.Wrap(err, "get podman system info") - } - rawJson = rr.Stdout.String() + rawJson, err := podmanInfoGetter() + if err != nil { + return ps, errors.Wrap(err, "podman system info") } if err := json.Unmarshal([]byte(strings.TrimSpace(rawJson)), &ps); err != nil { diff --git a/pkg/drivers/kic/oci/info_test.go b/pkg/drivers/kic/oci/info_test.go index bbeffe9265..597ff39ec6 100644 --- a/pkg/drivers/kic/oci/info_test.go +++ b/pkg/drivers/kic/oci/info_test.go @@ -1,6 +1,13 @@ package oci -import "testing" +import ( + "testing" +) + +var daemonResponseMock string +var daemonInfoGetterMock = func() (string, error) { + return daemonResponseMock, nil +} func TestDockerSystemInfo(t *testing.T) { testCases := []struct { @@ -109,7 +116,12 @@ func TestDockerSystemInfo(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - s, err := DaemonInfo(tc.OciBin, tc.RawJSON) + daemonResponseMock = tc.RawJSON + // setting up mock funcs + dockerInfoGetter = daemonInfoGetterMock + podmanInfoGetter = daemonInfoGetterMock + s, err := DaemonInfo(tc.OciBin) + if err != nil && !tc.ShouldError { t.Errorf("Expected not to have error but got %v", err) } From 25dc0cd0f76e51816aebb54bb8dd0091a31595d7 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 11 Aug 2020 15:03:10 -0700 Subject: [PATCH 4/6] lint --- pkg/drivers/kic/oci/info.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/drivers/kic/oci/info.go b/pkg/drivers/kic/oci/info.go index ef48b9209e..e27aed0204 100644 --- a/pkg/drivers/kic/oci/info.go +++ b/pkg/drivers/kic/oci/info.go @@ -232,11 +232,11 @@ var dockerInfoGetter = func() (string, error) { // dockerSystemInfo returns docker system info --format '{{json .}}' func dockerSystemInfo() (dockerSysInfo, error) { var ds dockerSysInfo - rawJson, err := dockerInfoGetter() + rawJSON, err := dockerInfoGetter() if err != nil { return ds, errors.Wrap(err, "docker system info") } - if err := json.Unmarshal([]byte(strings.TrimSpace(rawJson)), &ds); err != nil { + if err := json.Unmarshal([]byte(strings.TrimSpace(rawJSON)), &ds); err != nil { return ds, errors.Wrapf(err, "unmarshal docker system info") } @@ -251,12 +251,12 @@ var podmanInfoGetter = func() (string, error) { // podmanSysInfo returns podman system info --format '{{json .}}' func podmanSystemInfo() (podmanSysInfo, error) { var ps podmanSysInfo - rawJson, err := podmanInfoGetter() + rawJSON, err := podmanInfoGetter() if err != nil { return ps, errors.Wrap(err, "podman system info") } - if err := json.Unmarshal([]byte(strings.TrimSpace(rawJson)), &ps); err != nil { + if err := json.Unmarshal([]byte(strings.TrimSpace(rawJSON)), &ps); err != nil { return ps, errors.Wrapf(err, "unmarshal podman system info") } return ps, nil From f20d3bddf06f1ecf7abbb0a76c42cbd5c6badf39 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 11 Aug 2020 15:13:16 -0700 Subject: [PATCH 5/6] add boilerplate --- pkg/drivers/kic/oci/info_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/drivers/kic/oci/info_test.go b/pkg/drivers/kic/oci/info_test.go index 597ff39ec6..75ff96fdd1 100644 --- a/pkg/drivers/kic/oci/info_test.go +++ b/pkg/drivers/kic/oci/info_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 The Kubernetes Authors All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package oci import ( From 9a931c4516a10690e6946c8064e607c9a5beace5 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 11 Aug 2020 15:49:19 -0700 Subject: [PATCH 6/6] adjust timeout --- .github/workflows/master.yml | 4 ++-- .github/workflows/pr.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a6eace856f..96e08ddc0e 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -794,7 +794,7 @@ jobs: cp minikube-darwin-amd64 minikube chmod a+x minikube* START_TIME=$(date -u +%s) - KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=15m -test.v -timeout-multiplier=3 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt + KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=20m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt END_TIME=$(date -u +%s) TIME_ELAPSED=$(($END_TIME-$START_TIME)) min=$((${TIME_ELAPSED}/60)) @@ -980,7 +980,7 @@ jobs: chmod a+x e2e-* chmod a+x minikube-* START_TIME=$(date -u +%s) - KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--driver=virtualbox -test.run "TestMultiNode" -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt + KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--driver=virtualbox -test.run "TestMultiNode" -test.timeout=17m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt END_TIME=$(date -u +%s) TIME_ELAPSED=$(($END_TIME-$START_TIME)) min=$((${TIME_ELAPSED}/60)) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4e83727fb8..379eecfb2a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -792,7 +792,7 @@ jobs: cp minikube-darwin-amd64 minikube chmod a+x minikube* START_TIME=$(date -u +%s) - KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=15m -test.v -timeout-multiplier=3 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt + KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--vm-driver=virtualbox -test.run "(TestAddons|TestCertOptions|TestSkaffold)" -test.timeout=20m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt END_TIME=$(date -u +%s) TIME_ELAPSED=$(($END_TIME-$START_TIME)) min=$((${TIME_ELAPSED}/60)) @@ -978,7 +978,7 @@ jobs: chmod a+x e2e-* chmod a+x minikube-* START_TIME=$(date -u +%s) - KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--driver=virtualbox -test.run "TestMultiNode" -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt + KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-darwin-amd64 -minikube-start-args=--driver=virtualbox -test.run "TestMultiNode" -test.timeout=17m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt END_TIME=$(date -u +%s) TIME_ELAPSED=$(($END_TIME-$START_TIME)) min=$((${TIME_ELAPSED}/60))