diff --git a/pkg/minikube/config/profile_test.go b/pkg/minikube/config/profile_test.go index 73a43ce38b..392c6f670c 100644 --- a/pkg/minikube/config/profile_test.go +++ b/pkg/minikube/config/profile_test.go @@ -21,6 +21,7 @@ import ( "testing" ) +// TestListProfiles uses a different uses different MINIKUBE_HOME with rest of tests since it relies on file list index func TestListProfiles(t *testing.T) { miniDir, err := filepath.Abs("./testdata/.minikube") if err != nil { @@ -71,8 +72,9 @@ func TestListProfiles(t *testing.T) { } } + func TestProfileExists(t *testing.T) { - miniDir, err := filepath.Abs("./testdata/.minikube") + miniDir, err := filepath.Abs("./testdata/.minikube2") if err != nil { t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) } @@ -99,7 +101,7 @@ func TestProfileExists(t *testing.T) { } func TestCreateEmptyProfile(t *testing.T) { - miniDir, err := filepath.Abs("./testdata/.minikube") + miniDir, err := filepath.Abs("./testdata/.minikube2") if err != nil { t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) } @@ -130,7 +132,7 @@ func TestCreateEmptyProfile(t *testing.T) { } func TestCreateProfile(t *testing.T) { - miniDir, err := filepath.Abs("./testdata/.minikube") + miniDir, err := filepath.Abs("./testdata/.minikube2") if err != nil { t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) } @@ -166,7 +168,7 @@ func TestCreateProfile(t *testing.T) { } func TestDeleteProfile(t *testing.T) { - miniDir, err := filepath.Abs("./testdata/.minikube") + miniDir, err := filepath.Abs("./testdata/.minikube2") if err != nil { t.Errorf("error getting dir path for ./testdata/.minikube : %v", err) } diff --git a/pkg/minikube/config/testdata/.minikube/profiles/p13/config.json b/pkg/minikube/config/testdata/.minikube/profiles/p13/config.json deleted file mode 100644 index 65818246a5..0000000000 --- a/pkg/minikube/config/testdata/.minikube/profiles/p13/config.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "MachineConfig": { - "KeepContext": false, - "MinikubeISO": "", - "Memory": 0, - "CPUs": 0, - "DiskSize": 0, - "VMDriver": "", - "ContainerRuntime": "", - "HyperkitVpnKitSock": "", - "HyperkitVSockPorts": null, - "DockerEnv": null, - "InsecureRegistry": null, - "RegistryMirror": null, - "HostOnlyCIDR": "", - "HypervVirtualSwitch": "", - "KVMNetwork": "", - "KVMQemuURI": "", - "KVMGPU": false, - "KVMHidden": false, - "DockerOpt": null, - "DisableDriverMounts": false, - "NFSShare": null, - "NFSSharesRoot": "", - "UUID": "", - "NoVTXCheck": false, - "DNSProxy": false, - "HostDNSResolver": false - }, - "KubernetesConfig": { - "KubernetesVersion": "", - "NodeIP": "", - "NodePort": 0, - "NodeName": "", - "APIServerName": "", - "APIServerNames": null, - "APIServerIPs": null, - "DNSDomain": "", - "ContainerRuntime": "", - "CRISocket": "", - "NetworkPlugin": "", - "FeatureGates": "", - "ServiceCIDR": "", - "ImageRepository": "", - "ExtraOptions": null, - "ShouldLoadCachedImages": false, - "EnableDefaultCNI": false - } -} \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube/profiles/p_empty_config/config.json b/pkg/minikube/config/testdata/.minikube/profiles/p_empty_config/config.json deleted file mode 100644 index 65818246a5..0000000000 --- a/pkg/minikube/config/testdata/.minikube/profiles/p_empty_config/config.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "MachineConfig": { - "KeepContext": false, - "MinikubeISO": "", - "Memory": 0, - "CPUs": 0, - "DiskSize": 0, - "VMDriver": "", - "ContainerRuntime": "", - "HyperkitVpnKitSock": "", - "HyperkitVSockPorts": null, - "DockerEnv": null, - "InsecureRegistry": null, - "RegistryMirror": null, - "HostOnlyCIDR": "", - "HypervVirtualSwitch": "", - "KVMNetwork": "", - "KVMQemuURI": "", - "KVMGPU": false, - "KVMHidden": false, - "DockerOpt": null, - "DisableDriverMounts": false, - "NFSShare": null, - "NFSSharesRoot": "", - "UUID": "", - "NoVTXCheck": false, - "DNSProxy": false, - "HostDNSResolver": false - }, - "KubernetesConfig": { - "KubernetesVersion": "", - "NodeIP": "", - "NodePort": 0, - "NodeName": "", - "APIServerName": "", - "APIServerNames": null, - "APIServerIPs": null, - "DNSDomain": "", - "ContainerRuntime": "", - "CRISocket": "", - "NetworkPlugin": "", - "FeatureGates": "", - "ServiceCIDR": "", - "ImageRepository": "", - "ExtraOptions": null, - "ShouldLoadCachedImages": false, - "EnableDefaultCNI": false - } -} \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube/profiles/p_partial_config/config.json b/pkg/minikube/config/testdata/.minikube/profiles/p_partial_config/config.json deleted file mode 100644 index 65818246a5..0000000000 --- a/pkg/minikube/config/testdata/.minikube/profiles/p_partial_config/config.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "MachineConfig": { - "KeepContext": false, - "MinikubeISO": "", - "Memory": 0, - "CPUs": 0, - "DiskSize": 0, - "VMDriver": "", - "ContainerRuntime": "", - "HyperkitVpnKitSock": "", - "HyperkitVSockPorts": null, - "DockerEnv": null, - "InsecureRegistry": null, - "RegistryMirror": null, - "HostOnlyCIDR": "", - "HypervVirtualSwitch": "", - "KVMNetwork": "", - "KVMQemuURI": "", - "KVMGPU": false, - "KVMHidden": false, - "DockerOpt": null, - "DisableDriverMounts": false, - "NFSShare": null, - "NFSSharesRoot": "", - "UUID": "", - "NoVTXCheck": false, - "DNSProxy": false, - "HostDNSResolver": false - }, - "KubernetesConfig": { - "KubernetesVersion": "", - "NodeIP": "", - "NodePort": 0, - "NodeName": "", - "APIServerName": "", - "APIServerNames": null, - "APIServerIPs": null, - "DNSDomain": "", - "ContainerRuntime": "", - "CRISocket": "", - "NetworkPlugin": "", - "FeatureGates": "", - "ServiceCIDR": "", - "ImageRepository": "", - "ExtraOptions": null, - "ShouldLoadCachedImages": false, - "EnableDefaultCNI": false - } -} \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p1/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p1/config.json new file mode 100644 index 0000000000..86699a29bb --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p1/config.json @@ -0,0 +1,50 @@ +{ + "MachineConfig": { + "KeepContext": false, + "MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso", + "Memory": 2000, + "CPUs": 2, + "DiskSize": 20000, + "VMDriver": "hyperkit", + "ContainerRuntime": "docker", + "HyperkitVpnKitSock": "", + "HyperkitVSockPorts": [], + "XhyveDiskDriver": "ahci-hd", + "DockerEnv": null, + "InsecureRegistry": null, + "RegistryMirror": null, + "HostOnlyCIDR": "192.168.99.1/24", + "HypervVirtualSwitch": "", + "KVMNetwork": "default", + "KVMQemuURI": "qemu:///system", + "KVMGPU": false, + "KVMHidden": false, + "DockerOpt": null, + "DisableDriverMounts": false, + "NFSShare": [], + "NFSSharesRoot": "/nfsshares", + "UUID": "", + "NoVTXCheck": false, + "DNSProxy": false, + "HostDNSResolver": true + }, + "KubernetesConfig": { + "KubernetesVersion": "v1.15.0", + "NodeIP": "192.168.64.75", + "NodePort": 8443, + "NodeName": "minikube", + "APIServerName": "minikubeCA", + "APIServerNames": null, + "APIServerIPs": null, + "DNSDomain": "cluster.local", + "ContainerRuntime": "docker", + "CRISocket": "", + "NetworkPlugin": "", + "FeatureGates": "", + "ServiceCIDR": "10.96.0.0/12", + "ImageRepository": "", + "ExtraOptions": null, + "ShouldLoadCachedImages": true, + "EnableDefaultCNI": false + } +} \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p2/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p2/config.json new file mode 100644 index 0000000000..d77e0221d2 --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p2/config.json @@ -0,0 +1,49 @@ +{ + "MachineConfig": { + "KeepContext": false, + "MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso", + "Memory": 2000, + "CPUs": 2, + "DiskSize": 20000, + "VMDriver": "virtualbox", + "ContainerRuntime": "docker", + "HyperkitVpnKitSock": "", + "HyperkitVSockPorts": [], + "DockerEnv": null, + "InsecureRegistry": null, + "RegistryMirror": null, + "HostOnlyCIDR": "192.168.99.1/24", + "HypervVirtualSwitch": "", + "KVMNetwork": "default", + "KVMQemuURI": "qemu:///system", + "KVMGPU": false, + "KVMHidden": false, + "DockerOpt": null, + "DisableDriverMounts": false, + "NFSShare": [], + "NFSSharesRoot": "/nfsshares", + "UUID": "", + "NoVTXCheck": false, + "DNSProxy": false, + "HostDNSResolver": true + }, + "KubernetesConfig": { + "KubernetesVersion": "v1.15.0", + "NodeIP": "192.168.99.136", + "NodePort": 8443, + "NodeName": "minikube", + "APIServerName": "minikubeCA", + "APIServerNames": null, + "APIServerIPs": null, + "DNSDomain": "cluster.local", + "ContainerRuntime": "docker", + "CRISocket": "", + "NetworkPlugin": "", + "FeatureGates": "", + "ServiceCIDR": "10.96.0.0/12", + "ImageRepository": "", + "ExtraOptions": null, + "ShouldLoadCachedImages": true, + "EnableDefaultCNI": false + } +} \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p3_empty/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p3_empty/config.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p4_invalid_file/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p4_invalid_file/config.json new file mode 100644 index 0000000000..9e2e347718 --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p4_invalid_file/config.json @@ -0,0 +1 @@ +invalid json file :) \ No newline at end of file diff --git a/pkg/minikube/config/testdata/.minikube2/profiles/p5_partial_config/config.json b/pkg/minikube/config/testdata/.minikube2/profiles/p5_partial_config/config.json new file mode 100644 index 0000000000..29f62c0149 --- /dev/null +++ b/pkg/minikube/config/testdata/.minikube2/profiles/p5_partial_config/config.json @@ -0,0 +1,47 @@ +{ + "MachineConfig": { + "KeepContext": false, + "MinikubeISO": "https://storage.googleapis.com/minikube/iso/minikube-v1.2.0.iso", + "Memory": 2000, + "CPUs": 2, + "DiskSize": 20000, + "ContainerRuntime": "docker", + "HyperkitVpnKitSock": "", + "HyperkitVSockPorts": [], + "XhyveDiskDriver": "ahci-hd", + "DockerEnv": null, + "InsecureRegistry": null, + "RegistryMirror": null, + "HostOnlyCIDR": "192.168.99.1/24", + "HypervVirtualSwitch": "", + "KVMNetwork": "default", + "KVMQemuURI": "qemu:///system", + "KVMGPU": false, + "KVMHidden": false, + "DockerOpt": null, + "DisableDriverMounts": false, + "NFSShare": [], + "NFSSharesRoot": "/nfsshares", + "UUID": "", + "NoVTXCheck": false, + "DNSProxy": false, + "HostDNSResolver": true + }, + "KubernetesConfig": { + "NodePort": 8443, + "NodeName": "minikube", + "APIServerName": "minikubeCA", + "APIServerNames": null, + "APIServerIPs": null, + "DNSDomain": "cluster.local", + "ContainerRuntime": "docker", + "CRISocket": "", + "NetworkPlugin": "", + "FeatureGates": "", + "ServiceCIDR": "10.96.0.0/12", + "ImageRepository": "", + "ExtraOptions": null, + "ShouldLoadCachedImages": true, + "EnableDefaultCNI": false + } +} \ No newline at end of file