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

Issue #141 Replace avocado based tests with shell scripts based test #152

Merged
merged 1 commit into from
Sep 26, 2017
Merged

Conversation

coolbrg
Copy link
Contributor

@coolbrg coolbrg commented Sep 20, 2017

Fix #141

Not a shell programmer. Let me know if tests can be improved.

@coolbrg coolbrg requested a review from gbraad September 20, 2017 16:19
@coolbrg
Copy link
Contributor Author

coolbrg commented Sep 20, 2017

Tests results:

sh tests/test.sh
-- Installing default add-ons ... OK
-- Checking if KVM driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ... 
   Checking driver binary is executable ... OK
-- Starting local OpenShift cluster using 'kvm' hypervisor ...
-- Minishift VM will be configured with ...
   Memory:    2 GB
   vCPUs :    2
   Disk size: 20 GB
-- Starting Minishift VM ....(minishift) Trying to access option swarm-master which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to bool for key swarm-master
(minishift) Trying to access option swarm-host which does not exist
Creating CA: /root/.minishift/certs/ca.pem
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-host
(minishift) Trying to access option swarm-discovery which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-discovery
Creating client certificate: /root/.minishift/certs/cert.pem
Running pre-create checks...
Creating machine...
(minishift) Downloading /root/.minishift/cache/boot2docker.iso from file:///root/payload/build/minishift-centos7.iso...
..........Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
..Detecting the provisioner...
Provisioning with minishift...

   Setting hostname ... 
OK
.Copying certs to the local machine directory...
Copying certs to the remote machine...
.Setting Docker configuration on the remote daemon...
..Checking connection to Docker...
Docker is up and running!
 OK
-- Checking for IP address ... OK
-- Checking if external host is reachable from the Minishift VM ... 
   Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ... 
   Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 1% OK
-- Downloading OpenShift binary 'oc' version 'v3.6.0'
 34.72 MiB / 34.72 MiB [==========================================================================================================================================================] 100.00% 0s-- Downloading OpenShift v3.6.0 checksums ... OK
-- OpenShift cluster will be configured with ...
   Version: v3.6.0
-- Checking `oc` support for startup flags ... 
   host-config-dir ... OK
   host-data-dir ... OK
   host-pv-dir ... OK
   host-volumes-dir ... OK
   routing-suffix ... OK
Starting OpenShift using openshift/origin:v3.6.0 ...
Pulling image openshift/origin:v3.6.0
Pulled 1/4 layers, 26% complete
Pulled 2/4 layers, 74% complete
Pulled 3/4 layers, 89% complete
Pulled 4/4 layers, 100% complete
Extracting
Image pull complete
OpenShift server started.

The server is accessible via web console at:
    https://192.168.42.212:8443

You are logged in as:
    User:     developer
    Password: <any value>

To login as administrator:
    oc login -u system:admin


 ------------ [ Starting VM - Passed ]

Stopping local OpenShift cluster...
Cluster stopped.

 ------------ [ Stopping VM - Passed ]

-- Checking if KVM driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ... 
   Checking driver binary is executable ... OK
-- Starting local OpenShift cluster using 'kvm' hypervisor ...
-- Starting Minishift VM .......Waiting for SSH to be available...
......Detecting the provisioner...

   Setting hostname ... 
OK
.Copying certs to the local machine directory...
.Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
. OK
-- Checking for IP address ... OK
-- Checking if external host is reachable from the Minishift VM ... 
   Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ... 
   Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 7% OK
-- OpenShift cluster will be configured with ...
   Version: v3.6.0
-- Checking `oc` support for startup flags ... 
   routing-suffix ... OK
   host-config-dir ... OK
   host-data-dir ... OK
   host-pv-dir ... OK
   host-volumes-dir ... OK
Starting OpenShift using openshift/origin:v3.6.0 ...
OpenShift server started.

The server is accessible via web console at:
    https://192.168.42.212:8443


 ------------ [ Starting VM - Passed ]


 ------------ [ Swap space check - Passed ]


 ------------ [ Getting VM IP - Passed ]

FUSE library version: 2.9.2
using FUSE kernel interface version 7.19
fusermount version: 2.9.2 SSHFS version 2.5

 ------------ [ SSHFS installation - Passed ]

mount.cifs version: 6.2

 ------------ [ CIFS installation - Passed ]

FUSE library version: 2.9.2
using FUSE kernel interface version 7.19
fusermount version: 2.9.2 SSHFS version 2.5

 ------------ [ SSHFS installation - Passed ]


 ------------ [ NFS installation - Passed ]


 ------------ [ Bind mount check - Passed ]

Deleting the Minishift VM...
Minishift VM deleted.

 ------------ [ Deleting VM - Passed ]

@coolbrg
Copy link
Contributor Author

coolbrg commented Sep 21, 2017

@coolbrg
Copy link
Contributor Author

coolbrg commented Sep 21, 2017

retest this please

@LalatenduMohanty
Copy link
Member

@budhrg At least the test passed this time 👍

@coolbrg
Copy link
Contributor Author

coolbrg commented Sep 21, 2017

@LalatenduMohanty , Passed twice from yesterday

tests/test.sh Outdated

BINARY=build/bin/minishift
ISO=file:///root/payload/build/minishift-centos7.iso
EXTRA_FLAGS="--show-libmachine-logs"
Copy link
Member

Choose a reason for hiding this comment

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

This will make running tests locally very difficult. I think we still want to keep it easier for contributors to run the test locally. WDYT?

@LalatenduMohanty
Copy link
Member

LalatenduMohanty commented Sep 21, 2017

make test fails for me as I do not have the ISO in the expected path. I expect some better error messages saying what I need to do to make it work.

$ make test
sh tests/test.sh
-- Checking if KVM driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ... 
   Checking driver binary is executable ... OK
-- Starting local OpenShift cluster using 'kvm' hypervisor ...
-- Minishift VM will be configured with ...
   Memory:    4 GB
   vCPUs :    2
   Disk size: 20 GB
-- Starting Minishift VM ....(minishift) Trying to access option swarm-master which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to bool for key swarm-master
(minishift) Trying to access option swarm-host which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-host
(minishift) Trying to access option swarm-discovery which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-discovery
Running pre-create checks...
Creating machine...
(minishift) Downloading /home/lmohanty/.minishift/cache/boot2docker.iso from file:///root/payload/build/minishift-centos7.iso...
. FAIL E0921 17:15:51.234110   27348 start.go:335] Error starting the VM: Error creating the VM. Error creating machine: Error in driver during machine creation: open /root/payload/build/minishift-centos7.iso: permission denied. Retrying.
(minishift) Failed to fetch machine
 FAIL E0921 17:15:51.278718   27348 start.go:335] Error starting the VM: Error getting the state for host: unexpected EOF. Retrying.
(minishift) Failed to fetch machine
 FAIL E0921 17:15:51.311158   27348 start.go:335] Error starting the VM: Error getting the state for host: unexpected EOF. Retrying.
Error starting the VM: Error creating the VM. Error creating machine: Error in driver during machine creation: open /root/payload/build/minishift-centos7.iso: permission denied
Error getting the state for host: unexpected EOF
Error getting the state for host: unexpected EOF
Error starting Minishift VM
Makefile:90: recipe for target 'test' failed
make: *** [test] Error 1

@LalatenduMohanty
Copy link
Member

LalatenduMohanty commented Sep 22, 2017

@budhrg When I am trying the PR locally, it is failing for me. Have you seen this?

$ make test
sh tests/test.sh
-- Checking if KVM driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ... 
   Checking driver binary is executable ... OK
-- Starting local OpenShift cluster using 'kvm' hypervisor ...
-- Minishift VM will be configured with ...
   Memory:    4 GB
   vCPUs :    2
   Disk size: 20 GB
-- Starting Minishift VM ....(minishift) Trying to access option swarm-master which does not exist
Running pre-create checks...
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to bool for key swarm-master
(minishift) Trying to access option swarm-host which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-host
(minishift) Trying to access option swarm-discovery which does not exist
(minishift) THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
(minishift) Type assertion did not go smoothly to string for key swarm-discovery
Creating machine...
(minishift) Downloading /home/lmohanty/.minishift/cache/boot2docker.iso from file:///home/lmohanty/GoCode/src/github.com/minishift/minishift-centos-iso/build/minishift-centos7.iso...
.............Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
.Detecting the provisioner...
Provisioning with minishift...

   Setting hostname ... 
.OK
Copying certs to the local machine directory...
.Copying certs to the remote machine...
.Setting Docker configuration on the remote daemon...
.Checking connection to Docker...
Docker is up and running!
 OK
-- Checking for IP address ... OK
-- Checking if external host is reachable from the Minishift VM ... 
   Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ... 
   Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 1% OK
-- OpenShift cluster will be configured with ...
   Version: v3.6.0
-- Checking `oc` support for startup flags ... 
   host-config-dir ... OK
   host-data-dir ... OK
   host-pv-dir ... OK
   host-volumes-dir ... OK
   routing-suffix ... OK
Starting OpenShift using openshift/origin:v3.6.0 ...
Pulling image openshift/origin:v3.6.0
Pulled 1/4 layers, 27% complete
Pulled 2/4 layers, 84% complete
Pulled 3/4 layers, 89% complete
Pulled 4/4 layers, 100% complete
Extracting
Image pull complete
OpenShift server started.

The server is accessible via web console at:
    https://192.168.42.243:8443

You are logged in as:
    User:     developer
    Password: <any value>

To login as administrator:
    oc login -u system:admin


 ------------ [ Starting VM - Passed ]

Stopping local OpenShift cluster...
Cluster stopped.

 ------------ [ Stopping VM - Passed ]

-- Checking if KVM driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-kvm ... 
   Checking driver binary is executable ... OK
-- Starting local OpenShift cluster using 'kvm' hypervisor ...
-- Starting Minishift VM .......Waiting for SSH to be available...
.........Detecting the provisioner...

   Setting hostname ... 
OK
.Error getting SSH command to check if the daemon is running: ssh command error:
command : sudo docker version
err     : exit status 1
output  : Client:
 Version:         1.12.6
 API version:     1.24
 Package version: docker-1.12.6-48.git0fdc778.el7.centos.x86_64
 Go version:      go1.8.3
 Git commit:      0fdc778/1.12.6
 Built:           Thu Sep  7 18:00:07 2017
 OS/Arch:         linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

.Error getting SSH command to check if the daemon is running: ssh command error:
command : sudo docker version
err     : exit status 1
output  : Client:
 Version:         1.12.6
 API version:     1.24
 Package version: docker-1.12.6-48.git0fdc778.el7.centos.x86_64
 Go version:      go1.8.3
 Git commit:      0fdc778/1.12.6
 Built:           Thu Sep  7 18:00:07 2017
 OS/Arch:         linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

.Error getting SSH command to check if the daemon is running: ssh command error:
command : sudo docker version
err     : exit status 1
output  : Client:
 Version:         1.12.6
 API version:     1.24
 Package version: docker-1.12.6-48.git0fdc778.el7.centos.x86_64
 Go version:      go1.8.3
 Git commit:      0fdc778/1.12.6
 Built:           Thu Sep  7 18:00:07 2017
 OS/Arch:         linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

.Error getting SSH command to check if the daemon is running: ssh command error:
command : sudo docker version
err     : exit status 1
output  : Client:
 Version:         1.12.6
 API version:     1.24
 Package version: docker-1.12.6-48.git0fdc778.el7.centos.x86_64
 Go version:      go1.8.3
 Git commit:      0fdc778/1.12.6
 Built:           Thu Sep  7 18:00:07 2017
 OS/Arch:         linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

]$ minishift ssh
[docker@minishift ~]$ 
[docker@minishift ~]$ docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

@coolbrg
Copy link
Contributor Author

coolbrg commented Sep 22, 2017

When I am trying the PR locally, it is failing for me. Have you seen this?

@LalatenduMohanty , you are able to reproduce locally the issue #121

Also, is that binary latest? and CentOS iso?

@LalatenduMohanty
Copy link
Member

@budhrg Yes, both latest. I think it is #121, let me dig little more.

@coolbrg
Copy link
Contributor Author

coolbrg commented Sep 22, 2017

Yes, both latest. I think it is #121, let me dig little more.

Not reproducible for me in my machine. @praveenkumar could you check?

@praveenkumar
Copy link
Collaborator

I did try on my machine and looks like everything is passed.

- Starting Minishift VM .......Waiting for SSH to be available...
.......Detecting the provisioner...

   Setting hostname ... 
.OK
Copying certs to the local machine directory...
.Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
. OK
-- Checking for IP address ... OK
-- Checking if external host is reachable from the Minishift VM ... 
   Pinging 8.8.8.8 ... OK
-- Checking HTTP connectivity from the VM ... 
   Retrieving http://minishift.io/index.html ... OK
-- Checking if persistent storage volume is mounted ... OK
-- Checking available disk space ... 7% OK
-- OpenShift cluster will be configured with ...
   Version: v3.6.0
-- Checking `oc` support for startup flags ... 
   host-data-dir ... OK
   host-pv-dir ... OK
   host-volumes-dir ... OK
   routing-suffix ... OK
   host-config-dir ... OK
Starting OpenShift using openshift/origin:v3.6.0 ...
OpenShift server started.

The server is accessible via web console at:
    https://192.168.42.189:8443


 ------------ [ Starting VM - Passed ]


 ------------ [ Swap space check - Passed ]


 ------------ [ Getting VM IP - Passed ]

FUSE library version: 2.9.2
using FUSE kernel interface version 7.19
fusermount version: 2.9.2 SSHFS version 2.5

 ------------ [ SSHFS installation - Passed ]

mount.cifs version: 6.2

 ------------ [ CIFS installation - Passed ]

FUSE library version: 2.9.2
using FUSE kernel interface version 7.19
fusermount version: 2.9.2 SSHFS version 2.5

 ------------ [ SSHFS installation - Passed ]


 ------------ [ NFS installation - Passed ]


 ------------ [ Bind mount check - Passed ]

Deleting the Minishift VM...
Minishift VM deleted.

 ------------ [ Deleting VM - Passed ]

@coolbrg
Copy link
Contributor Author

coolbrg commented Sep 26, 2017

@LalatenduMohanty , could you do the needful action here? Anything needed in this PR?

@LalatenduMohanty
Copy link
Member

LalatenduMohanty commented Sep 26, 2017

I am not able to reproduce this if I run manually minishift start->stop->start multiple time with CentOS ISO. However I can reproduce it every time with make test.

tests/test.sh Outdated
# Tests
verify_start_instance
verify_stop_instance
sleep 90
Copy link
Member

Choose a reason for hiding this comment

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

The sleep should be after the start command as I found in my local tests.

@coolbrg coolbrg changed the title Issue #141 Replace avocado based tests with shell scripts based test [Don't Merge] Issue #141 Replace avocado based tests with shell scripts based test Sep 26, 2017
@coolbrg coolbrg changed the title [Don't Merge] Issue #141 Replace avocado based tests with shell scripts based test Issue #141 Replace avocado based tests with shell scripts based test Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants