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 #5 Add minishift smoke tests #18

Merged
merged 1 commit into from
Jan 18, 2017
Merged

Issue #5 Add minishift smoke tests #18

merged 1 commit into from
Jan 18, 2017

Conversation

coolbrg
Copy link
Contributor

@coolbrg coolbrg commented Jan 11, 2017

Fix #5

Should need changes from PR #13

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 11, 2017

@LalatenduMohanty Could you review PR?

@LalatenduMohanty
Copy link
Member

@budhrg I am not able to install avocado framework on OS X. Looking in to the issue.

Lalatendus-MacBook-Pro:minishift-b2d-iso lmohanty$ pip install avocado-framework
Collecting avocado-framework
  Using cached avocado-framework-42.0.tar.gz
Collecting stevedore (from avocado-framework)
  Using cached stevedore-1.19.1-py2.py3-none-any.whl
Collecting six>=1.9.0 (from stevedore->avocado-framework)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting pbr>=1.8 (from stevedore->avocado-framework)
  Using cached pbr-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, pbr, stevedore, avocado-framework
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/81/q3z841ds2yb7xblc91xww10m0000gn/T/pip-EXz0hj-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

@coolbrg coolbrg changed the title Issue #5 Add minishift smoke tests (WIP) Issue #5 Add minishift smoke tests Jan 12, 2017
@@ -32,3 +34,18 @@ release: b2d_iso get_gh-release
cp $(BUILD_DIR)/minishift-b2d.iso release/
$(BUILD_DIR)/gh-release checksums sha256
$(BUILD_DIR)/gh-release create minishift/minishift-b2d-iso $(VERSION) master v$(VERSION)

.PHONY: prepare_for_test
Copy link
Member

Choose a reason for hiding this comment

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

This is actually not a phony target. This is very much a target which you want to skip if the binary is there

.PHONY: prepare_for_test
prepare_for_test: DOCKER_MACHINE_PATH=$(BIN_DIR)/docker-machine
prepare_for_test:
@if [ ! -x $(DOCKER_MACHINE_PATH) ]; then \
Copy link
Member

Choose a reason for hiding this comment

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

This if statement is redundant, provided you make this a non phony target. Let's use the tools we use properly.

@@ -32,3 +34,18 @@ release: b2d_iso get_gh-release
cp $(BUILD_DIR)/minishift-b2d.iso release/
$(BUILD_DIR)/gh-release checksums sha256
$(BUILD_DIR)/gh-release create minishift/minishift-b2d-iso $(VERSION) master v$(VERSION)

.PHONY: prepare_for_test
prepare_for_test: DOCKER_MACHINE_PATH=$(BIN_DIR)/docker-machine
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you just set the variable at the top of the makefile? This variable does not change depending on the target

Copy link
Member

Choose a reason for hiding this comment

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

Also, why are we installing docker-machine? We want to add minishift smoke tests, right? So I would expect that this target gets the latest minishift release and "installs" it

Copy link
Member

Choose a reason for hiding this comment

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

Also, the Makefile seems to hardcode a Linux install. It would be nice if the right minishift version would be downloaded, so that for example these smoke tests can be run on OS X as well. I would not make this a requirement for getting this merged, but in the very least we would need a follow up issue trying to address OS problems.

@@ -11,6 +12,7 @@ init:
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
rm -rf $(BIN_DIR)
Copy link
Member

Choose a reason for hiding this comment

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

If you remove the bin dir as part of each clean, then I argue, you should make it a sub-directory of BUILD_DIR. Usually I am of the point of view, everything which gets installed/created during the build goes somewhere under build. A reason for not doing this, would be to have something which takes a long time to do (for example downloading the Vagrant boxes in CDK 2) and you want to cache it separately. If you want to do this, then you need two clean targets. Otherwise there is no use of this distinction. You could have for example 'clean' and 'clean-all'. It depends how you want to look at this. Right now, however, the potential purpose of "caching" the binary is not achieved.

<a name="tests"></a>
## Tests

Tests are written as Python scripts under `tests` directory and run through [Avocado](avocado-framework.readthedocs.io) framework. Ensure you have _Avocado_ installed by following [Avocado instllation guide](http://avocado-framework.readthedocs.io/en/44.0/GetStartedGuide.html#installing-avocado) before running any tests.
Copy link
Member

Choose a reason for hiding this comment

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

How would I install Avocado in OS X? I cannot install it via the package manager and it is not part of Mac Ports nor Homebrew (afaict)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hferentschik , It can be install via pip.

@amitkrout has installed in Mac OS https://paste.fedoraproject.org/525918/48421257.

Copy link
Member

Choose a reason for hiding this comment

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

@amitkrout has installed in Mac OS

How? what are the requirements and what do I execute?

Copy link
Member

Choose a reason for hiding this comment

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

I am confused by the paste:

dhcp-0-106:~ cdkqe$ avocado -v
Avocado 36.0lts

So at this stage Avocado seems already installed

dhcp-0-106:~ cdkqe$ pip install avocado-framework

and now avocado-framework is installed? What's that.

I don't make having OS X instructions a requirement to merge this, but at some stage I would appreciate if someone provides some re-producable instructions.

Copy link
Member

Choose a reason for hiding this comment

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

In the paste, avocado seems to be installed at the time avocado-framework is installed.

At some stage I'd like re-producable instructions on how to do this on OS X. However, this shall not hold up a merge of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes @hferentschik , we need that for OS X too. Will check with @amitkrout to see how he installed successfully .


def test_boot_vm_out_of_iso(self):
''' Test booting up VM out of ISO '''
cmd = self.bin_dir + "docker-machine create %s -d kvm --kvm-boot2docker-url=%s" % (self.docker_machine_vm, self.iso_file)
Copy link
Member

Choose a reason for hiding this comment

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

I am confused now. I thought we are adding minishift smoke tests. This is docker-machine, right? So at best we can verify that VM creation works. Fair enough, but for this particular repo I am more interested that this works with the latest version of minishift.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hferentschik
Copy link
Member

I am not able to install avocado framework on OS X. Looking in to the issue.

Not me either. There are instructions missing. AFAIR, there were some customs steps needed for install Avocado on OS X. The QE had some info around that.

@LalatenduMohanty and even if you could install Avocado it would still not work for you, since other parts (docker-machine install) is Linux specific. So right now, tests will anyways only run on Linux. I am ok with that to move things along, but it should be fairly simple to get this to work on OS X as well. IMO, this could be done in a follow up issue. As long as it builds on CI I am fine for now

However, I had minishift smoke tests in mind, not docker-machine!

@coolbrg coolbrg changed the title (WIP) Issue #5 Add minishift smoke tests Issue #5 Add minishift smoke tests Jan 12, 2017
@amitkrout
Copy link

amitkrout commented Jan 12, 2017

$ system_profiler SPSoftwareDataType

Software:

    System Software Overview:

      System Version: macOS 10.12.1 (16B2657)
      Kernel Version: Darwin 16.1.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: David’s MacBook Pro
      User Name: cdk qe team members (cdkqe)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Disabled
      Time since boot: 31 days 15 minutes

Avocado 42 installed without any error

$ pip install avocado-framework
Collecting avocado-framework
  Downloading avocado-framework-42.0.tar.gz (785kB)
    100% |████████████████████████████████| 788kB 940kB/s 
Requirement already satisfied (use --upgrade to upgrade): stevedore in /Library/Python/2.7/site-packages (from avocado-framework)
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in /Library/Python/2.7/site-packages (from stevedore->avocado-framework)
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /Library/Python/2.7/site-packages (from stevedore->avocado-framework)
Building wheels for collected packages: avocado-framework
  Running setup.py bdist_wheel for avocado-framework ... done
  Stored in directory: /Users/cdkqe/Library/Caches/pip/wheels/78/b3/94/3c8f8f441a8ebc527a327ff0d7dbfa93126718abc52e4c9fa0
Successfully built avocado-framework
Installing collected packages: avocado-framework
Successfully installed avocado-framework-42.0
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 12, 2017

@hferentschik @LalatenduMohanty @praveenkumar Updated the PR for minishift only tests.

Also, enabled running tests with showing logs on choice.

Once, we are fine with these tests, I will same for centos too. It's almost the exact copy/PR.

Log formats (Unfortunately only --show-job-log is available with avocado)

➜  minishift-b2d-iso git:(fix-5) ✗ make test      
avocado run  tests/test.py
JOB ID     : 01cd861849d2c032847621253f96be001e222af5
JOB LOG    : /home/budhram/avocado/job-results/job-2017-01-12T18.26-01cd861/job.log
TESTS      : 6
 (1/6) tests/test.py:MinishiftISOTest.test_boot_vm_out_of_iso: PASS (104.61 s)
 (2/6) tests/test.py:MinishiftISOTest.test_ssh_connection_to_vm: PASS (0.15 s)
 (3/6) tests/test.py:MinishiftISOTest.test_ip_of_vm: PASS (0.06 s)
 (4/6) tests/test.py:MinishiftISOTest.test_docker_env_evaluable: PASS (0.06 s)
 (5/6) tests/test.py:MinishiftISOTest.test_stopping_vm: PASS (1.43 s)
 (6/6) tests/test.py:MinishiftISOTest.test_removing_vm: PASS (0.24 s)
RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0
TESTS TIME : 106.55 s


# With SHOW_LOG switch 

➜  minishift-b2d-iso git:(fix-5) ✗ SHOW_LOG=--show-job-log make test
avocado run --show-job-log tests/test.py
Commands configured by file: /etc/avocado/sysinfo/commands
Files configured by file: /etc/avocado/sysinfo/files
Profilers configured by file: /etc/avocado/sysinfo/profilers
Profiler disabled
System log file not found (looked for ['/var/log/messages', '/var/log/syslog', '/var/log/system.log'])
Command line: /usr/bin/avocado run --show-job-log tests/test.py

Avocado version: 44.0

Config files read (in order):
/etc/avocado/avocado.conf
/etc/avocado/conf.d/gdb.conf
/home/budhram/.config/avocado/avocado.conf

Avocado config:
Section.Key                             Value
datadir.paths.base_dir                  /usr/share/avocado
datadir.paths.test_dir                  /usr/share/avocado/tests
datadir.paths.data_dir                  /usr/share/avocado/data
datadir.paths.logs_dir                  ~/avocado/job-results
sysinfo.collect.enabled                 True
sysinfo.collect.installed_packages      False
sysinfo.collect.profiler                False
sysinfo.collect.locale                  C
sysinfo.collectibles.commands           /etc/avocado/sysinfo/commands
sysinfo.collectibles.files              /etc/avocado/sysinfo/files
sysinfo.collectibles.profilers          /etc/avocado/sysinfo/profilers
runner.output.colored                   True
runner.output.utf8                      
remoter.behavior.reject_unknown_hosts   False
remoter.behavior.disable_known_hosts    False
job.output.loglevel                     info
restclient.connection.hostname          localhost
restclient.connection.port              9405
restclient.connection.username          
restclient.connection.password          
plugins.disable                         []
plugins.skip_broken_plugin_notification []
plugins.loaders                         ['file', '@DEFAULT']
gdb.paths.gdb                           /usr/bin/gdb
gdb.paths.gdbserver                     /usr/bin/gdbserver

Avocado Data Directories:

Avocado replaces config dirs that can't be accessed
with sensible defaults. Please edit your local config
file to customize values

base     /home/budhram/avocado
tests    /home/budhram/avocado/tests
data     /home/budhram/avocado/data
logs     /home/budhram/avocado/job-results

Temporary dir: /var/tmp/avocado_CuNnYs

Variant 1:    /

Job ID: 34583f656c4b8c6e1988e62a2f5503a72c6f7864

Commands configured by file: /etc/avocado/sysinfo/commands
Files configured by file: /etc/avocado/sysinfo/files
Profilers configured by file: /etc/avocado/sysinfo/profilers
Profiler disabled
System log file not found (looked for ['/var/log/messages', '/var/log/syslog', '/var/log/system.log'])
START 1-tests/test.py:MinishiftISOTest.test_boot_vm_out_of_iso
################################################################
Avocado version : 44.0
################################################################
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift start --vm-driver kvm --iso-url file:///home/budhram/redhat/minishift-b2d-iso/tests/../build/minishift-b2d.iso
PASS 1-tests/test.py:MinishiftISOTest.test_boot_vm_out_of_iso

Commands configured by file: /etc/avocado/sysinfo/commands
Files configured by file: /etc/avocado/sysinfo/files
Profilers configured by file: /etc/avocado/sysinfo/profilers
Profiler disabled
System log file not found (looked for ['/var/log/messages', '/var/log/syslog', '/var/log/system.log'])
START 2-tests/test.py:MinishiftISOTest.test_ssh_connection_to_vm
################################################################
Avocado version : 44.0
################################################################
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift ssh exit
PASS 2-tests/test.py:MinishiftISOTest.test_ssh_connection_to_vm

Commands configured by file: /etc/avocado/sysinfo/commands
Files configured by file: /etc/avocado/sysinfo/files
Profilers configured by file: /etc/avocado/sysinfo/profilers
Profiler disabled
System log file not found (looked for ['/var/log/messages', '/var/log/syslog', '/var/log/system.log'])
START 3-tests/test.py:MinishiftISOTest.test_ip_of_vm
################################################################
Avocado version : 44.0
################################################################
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift ip
PASS 3-tests/test.py:MinishiftISOTest.test_ip_of_vm

Commands configured by file: /etc/avocado/sysinfo/commands
Files configured by file: /etc/avocado/sysinfo/files
Profilers configured by file: /etc/avocado/sysinfo/profilers
Profiler disabled
System log file not found (looked for ['/var/log/messages', '/var/log/syslog', '/var/log/system.log'])
START 4-tests/test.py:MinishiftISOTest.test_docker_env_evaluable
################################################################
Avocado version : 44.0
################################################################
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift docker-env
PASS 4-tests/test.py:MinishiftISOTest.test_docker_env_evaluable

Commands configured by file: /etc/avocado/sysinfo/commands
Files configured by file: /etc/avocado/sysinfo/files
Profilers configured by file: /etc/avocado/sysinfo/profilers
Profiler disabled
System log file not found (looked for ['/var/log/messages', '/var/log/syslog', '/var/log/system.log'])
START 5-tests/test.py:MinishiftISOTest.test_stopping_vm
################################################################
Avocado version : 44.0
################################################################
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift stop
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift status
PASS 5-tests/test.py:MinishiftISOTest.test_stopping_vm

Commands configured by file: /etc/avocado/sysinfo/commands
Files configured by file: /etc/avocado/sysinfo/files
Profilers configured by file: /etc/avocado/sysinfo/profilers
Profiler disabled
System log file not found (looked for ['/var/log/messages', '/var/log/syslog', '/var/log/system.log'])
START 6-tests/test.py:MinishiftISOTest.test_removing_vm
################################################################
Avocado version : 44.0
################################################################
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift delete
Executing command : /home/budhram/redhat/minishift-b2d-iso/tests/../build/bin/minishift status
PASS 6-tests/test.py:MinishiftISOTest.test_removing_vm

Test results available in /home/budhram/avocado/job-results/job-2017-01-12T18.28-34583f6

@echo "Downloading minishift binary..."
@mkdir -p $(BIN_DIR)
@cd $(BIN_DIR) && \
curl -LO --progress-bar https://github.com/minishift/minishift/releases/download/v1.0.0-beta.2/minishift-1.0.0-beta.2-linux-amd64.tgz && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this smoke test now only works with linux because we are downloading only linux binary to do the testing?

Smoke test suppose to run in every OS so might be adding OS specific flag would be nice.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @hferentschik already specified it so let's go right now with it and then add a follow up issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

@budhrg hardcoded version here doesn't look good for minishift can we have some kind of script which will always retrieve latest available tarball. since we are using avocado so we assuming python would be there and so request module.

Check out https://gist.github.com/praveenkumar/f5e26a20f2b6a6640b86bc2934371bf9 if that make sense.

self.repo_dir = os.path.dirname(os.path.realpath(__file__)) + "/.."
self.scripts_dir = self.repo_dir + "/tests/"
self.bin_dir = self.repo_dir + "/build/bin/"
self.driver_name = 'kvm'
Copy link
Contributor

Choose a reason for hiding this comment

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

Here again it's OS specific, we can add flags to get proper driver,

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

Copy link
Member

Choose a reason for hiding this comment

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

+1, there are several things which won't work on other OS types, unless they are fixed.

@budhrg what's your intention? Do you want this to work on say OS X as well right now, or was your intention to fix this just for CI. We said both is ok, as long as in the long run we can get it to work on other OSes as well.

Copy link
Member

Choose a reason for hiding this comment

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

@budhrg If your intention is to make this work for other OS types right away, then this is indeed not going to work. Why can you not use the default (at least for now). Why setting the driver explicitly?

Copy link
Member

Choose a reason for hiding this comment

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

So what is the reply to this? For now only CentOS and Linux, right?

self.assertEqual(0, process.returncode)
self.assertEqual('Stopped', output.rstrip())

def test_removing_vm(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of remove I would say let's call it test_delete_vm just to align with our methods.

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 13, 2017

Created the follow up issue #20 to add support for Mac and Windows OS

@echo "Downloading minishift binary..."
@mkdir -p $(BIN_DIR)
@cd $(BIN_DIR) && \
curl -LO --progress-bar https://github.com/minishift/minishift/releases/download/v1.0.0-beta.2/minishift-1.0.0-beta.2-linux-amd64.tgz && \
Copy link
Contributor

Choose a reason for hiding this comment

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

@budhrg hardcoded version here doesn't look good for minishift can we have some kind of script which will always retrieve latest available tarball. since we are using avocado so we assuming python would be there and so request module.

Check out https://gist.github.com/praveenkumar/f5e26a20f2b6a6640b86bc2934371bf9 if that make sense.

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 13, 2017

Updated to fetch latest minishift version while downloading it.

Copy link
Member

@hferentschik hferentschik left a comment

Choose a reason for hiding this comment

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

Obviously I would like to this work somehow. OS X is not an option for now. @praveen, can you verify that this works?

@budhrg You need to decide whether you want this to just work for Linux now and CentOS CI and create a follow up issue or whether you want it to work for at least Linux + OS X now.


OS = os.getenv('OS', 'linux')

def main():
Copy link
Member

Choose a reason for hiding this comment

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

LOL, in python. I guess the tests are as well. If it works I am good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hferentschik Works like charm 😄 , provided by @praveenkumar in gist

self.repo_dir = os.path.dirname(os.path.realpath(__file__)) + "/.."
self.scripts_dir = self.repo_dir + "/tests/"
self.bin_dir = self.repo_dir + "/build/bin/"
self.driver_name = 'kvm'
Copy link
Member

Choose a reason for hiding this comment

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

+1, there are several things which won't work on other OS types, unless they are fixed.

@budhrg what's your intention? Do you want this to work on say OS X as well right now, or was your intention to fix this just for CI. We said both is ok, as long as in the long run we can get it to work on other OSes as well.

def test_boot_vm_out_of_iso(self):
''' Test booting up VM out of ISO '''
start_args = (self.driver_name, "file://" + self.iso_file)
cmd = self.bin_dir + "minishift start --vm-driver %s --iso-url %s" % start_args
Copy link
Member

Choose a reason for hiding this comment

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

Right, so now we have Minishift tests ;-)

<a name="tests"></a>
## Tests

Tests are written as Python scripts under `tests` directory and run through [Avocado](avocado-framework.readthedocs.io) framework. Ensure you have _Avocado_ installed by following [Avocado instllation guide](http://avocado-framework.readthedocs.io/en/44.0/GetStartedGuide.html#installing-avocado) before running any tests.
Copy link
Member

Choose a reason for hiding this comment

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

@amitkrout has installed in Mac OS

How? what are the requirements and what do I execute?

<a name="tests"></a>
## Tests

Tests are written as Python scripts under `tests` directory and run through [Avocado](avocado-framework.readthedocs.io) framework. Ensure you have _Avocado_ installed by following [Avocado instllation guide](http://avocado-framework.readthedocs.io/en/44.0/GetStartedGuide.html#installing-avocado) before running any tests.
Copy link
Member

Choose a reason for hiding this comment

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

I am confused by the paste:

dhcp-0-106:~ cdkqe$ avocado -v
Avocado 36.0lts

So at this stage Avocado seems already installed

dhcp-0-106:~ cdkqe$ pip install avocado-framework

and now avocado-framework is installed? What's that.

I don't make having OS X instructions a requirement to merge this, but at some stage I would appreciate if someone provides some re-producable instructions.

<a name="tests"></a>
## Tests

Tests are written as Python scripts under `tests` directory and run through [Avocado](avocado-framework.readthedocs.io) framework. Ensure you have _Avocado_ installed by following [Avocado instllation guide](http://avocado-framework.readthedocs.io/en/44.0/GetStartedGuide.html#installing-avocado) before running any tests.
Copy link
Member

Choose a reason for hiding this comment

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

In the paste, avocado seems to be installed at the time avocado-framework is installed.

At some stage I'd like re-producable instructions on how to do this on OS X. However, this shall not hold up a merge of this.

self.repo_dir = os.path.dirname(os.path.realpath(__file__)) + "/.."
self.scripts_dir = self.repo_dir + "/tests/"
self.bin_dir = self.repo_dir + "/build/bin/"
self.driver_name = 'kvm'
Copy link
Member

Choose a reason for hiding this comment

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

@budhrg If your intention is to make this work for other OS types right away, then this is indeed not going to work. Why can you not use the default (at least for now). Why setting the driver explicitly?

def test_boot_vm_out_of_iso(self):
''' Test booting up VM out of ISO '''
start_args = (self.driver_name, "file://" + self.iso_file)
cmd = self.bin_dir + "minishift start --vm-driver %s --iso-url %s" % start_args
Copy link
Member

Choose a reason for hiding this comment

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

+1 Right, minishift tests now :-)


OS = os.getenv('OS', 'linux')

def main():
Copy link
Member

Choose a reason for hiding this comment

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

LOL, Python. If it works ;-)

@mkdir -p $(BIN_DIR)
@cd $(BIN_DIR) && \
curl -LO --progress-bar $(MINISHIFT_LATEST_URL) && \
tar xzf $(ARCHIVE_FILE)
Copy link
Member

Choose a reason for hiding this comment

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

Just for the record, this might work for OS X and Linux, but not Windows. Remember there we have a zip.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya got it 👍

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 13, 2017

@budhrg You need to decide whether you want this to just work for Linux now and CentOS CI and create a follow up issue or whether you want it to work for at least Linux + OS X now.

@hferentschik I have already created the follow up issue #20

@praveenkumar
Copy link
Contributor

Something seems wrong to me. Check below result

$ make clean
rm -rf /home/prkumar/github/minishift-b2d-iso/build
rm -f /home/prkumar/github/minishift-b2d-iso/iso/os-release
[prkumar@cdk-prkumarws minishift-b2d-iso]$ make test
Downloading latest minishift binary...
######################################################################## 100.0%
Done.
avocado run  tests/test.py
JOB ID     : 72d31cec8472f775b861e9e772b729104595dad3
JOB LOG    : /home/prkumar/avocado/job-results/job-2017-01-13T18.10-72d31ce/job.log
TESTS      : 6
 (1/6) tests/test.py:MinishiftISOTest.test_boot_vm_out_of_iso: SKIP
 (2/6) tests/test.py:MinishiftISOTest.test_ssh_connection_to_vm: SKIP
 (3/6) tests/test.py:MinishiftISOTest.test_ip_of_vm: SKIP
 (4/6) tests/test.py:MinishiftISOTest.test_docker_env_evaluable: SKIP
 (5/6) tests/test.py:MinishiftISOTest.test_stopping_vm: SKIP
 (6/6) tests/test.py:MinishiftISOTest.test_delete_vm: SKIP
RESULTS    : PASS 0 | ERROR 0 | FAIL 0 | SKIP 6 | WARN 0 | INTERRUPT 0
TESTS TIME : 0.01 s

$ cat /home/prkumar/avocado/job-results/job-2017-01-13T18.10-72d31ce/job.log
2017-01-13 18:10:07,424 extension        L0156 DEBUG| found extension EntryPoint.parse('journal = avocado.plugins.journal:JournalResult')
2017-01-13 18:10:07,424 extension        L0156 DEBUG| found extension EntryPoint.parse('tap = avocado.plugins.tap:TAPResult')
2017-01-13 18:10:07,424 extension        L0156 DEBUG| found extension EntryPoint.parse('human = avocado.plugins.human:Human')
2017-01-13 18:10:07,427 extension        L0156 DEBUG| found extension EntryPoint.parse('jobscripts = avocado.plugins.jobscripts:JobScripts')
2017-01-13 18:10:07,428 sysinfo          L0388 INFO | Commands configured by file: /etc/avocado/sysinfo/commands
2017-01-13 18:10:07,428 sysinfo          L0399 INFO | Files configured by file: /etc/avocado/sysinfo/files
2017-01-13 18:10:07,428 sysinfo          L0419 INFO | Profilers configured by file: /etc/avocado/sysinfo/profilers
2017-01-13 18:10:07,428 sysinfo          L0427 INFO | Profiler disabled
2017-01-13 18:10:08,105 job              L0300 INFO | Command line: /usr/bin/avocado run tests/test.py
2017-01-13 18:10:08,105 job              L0301 INFO | 
2017-01-13 18:10:08,105 job              L0306 INFO | Avocado version: 43.0
2017-01-13 18:10:08,106 job              L0318 INFO | 
2017-01-13 18:10:08,106 job              L0323 INFO | Config files read (in order):
2017-01-13 18:10:08,106 job              L0325 INFO | /etc/avocado/avocado.conf
2017-01-13 18:10:08,106 job              L0325 INFO | /etc/avocado/conf.d/gdb.conf
2017-01-13 18:10:08,106 job              L0330 INFO | 
2017-01-13 18:10:08,106 job              L0332 INFO | Avocado config:
2017-01-13 18:10:08,107 job              L0341 INFO | Section.Key                             Value
2017-01-13 18:10:08,107 job              L0341 INFO | datadir.paths.base_dir                  /usr/share/avocado
2017-01-13 18:10:08,107 job              L0341 INFO | datadir.paths.test_dir                  /usr/share/avocado/tests
2017-01-13 18:10:08,107 job              L0341 INFO | datadir.paths.data_dir                  /usr/share/avocado/data
2017-01-13 18:10:08,107 job              L0341 INFO | datadir.paths.logs_dir                  ~/avocado/job-results
2017-01-13 18:10:08,107 job              L0341 INFO | sysinfo.collect.enabled                 True
2017-01-13 18:10:08,107 job              L0341 INFO | sysinfo.collect.installed_packages      False
2017-01-13 18:10:08,107 job              L0341 INFO | sysinfo.collect.profiler                False
2017-01-13 18:10:08,107 job              L0341 INFO | sysinfo.collect.locale                  C
2017-01-13 18:10:08,107 job              L0341 INFO | sysinfo.collectibles.commands           /etc/avocado/sysinfo/commands
2017-01-13 18:10:08,107 job              L0341 INFO | sysinfo.collectibles.files              /etc/avocado/sysinfo/files
2017-01-13 18:10:08,107 job              L0341 INFO | sysinfo.collectibles.profilers          /etc/avocado/sysinfo/profilers
2017-01-13 18:10:08,107 job              L0341 INFO | runner.output.colored                   True
2017-01-13 18:10:08,107 job              L0341 INFO | runner.output.utf8                      
2017-01-13 18:10:08,107 job              L0341 INFO | runner.behavior.keep_tmp_files          False
2017-01-13 18:10:08,107 job              L0341 INFO | remoter.behavior.reject_unknown_hosts   False
2017-01-13 18:10:08,108 job              L0341 INFO | remoter.behavior.disable_known_hosts    False
2017-01-13 18:10:08,108 job              L0341 INFO | job.output.loglevel                     debug
2017-01-13 18:10:08,108 job              L0341 INFO | restclient.connection.hostname          localhost
2017-01-13 18:10:08,108 job              L0341 INFO | restclient.connection.port              9405
2017-01-13 18:10:08,108 job              L0341 INFO | restclient.connection.username          
2017-01-13 18:10:08,108 job              L0341 INFO | restclient.connection.password          
2017-01-13 18:10:08,108 job              L0341 INFO | plugins.disable                         []
2017-01-13 18:10:08,108 job              L0341 INFO | plugins.skip_broken_plugin_notification []
2017-01-13 18:10:08,108 job              L0341 INFO | plugins.loaders                         ['file', '@DEFAULT']
2017-01-13 18:10:08,108 job              L0341 INFO | gdb.paths.gdb                           /usr/bin/gdb
2017-01-13 18:10:08,108 job              L0341 INFO | gdb.paths.gdbserver                     /usr/bin/gdbserver
2017-01-13 18:10:08,108 job              L0342 INFO | 
2017-01-13 18:10:08,108 job              L0347 INFO | Avocado Data Directories:
2017-01-13 18:10:08,108 job              L0348 INFO | 
2017-01-13 18:10:08,108 job              L0349 INFO | Avocado replaces config dirs that can't be accessed
2017-01-13 18:10:08,108 job              L0350 INFO | with sensible defaults. Please edit your local config
2017-01-13 18:10:08,108 job              L0351 INFO | file to customize values
2017-01-13 18:10:08,109 job              L0352 INFO | 
2017-01-13 18:10:08,111 job              L0353 INFO | base     /home/prkumar/avocado
2017-01-13 18:10:08,111 job              L0354 INFO | tests    /home/prkumar/avocado/tests
2017-01-13 18:10:08,112 job              L0355 INFO | data     /home/prkumar/avocado/data
2017-01-13 18:10:08,112 job              L0356 INFO | logs     /home/prkumar/avocado/job-results
2017-01-13 18:10:08,112 job              L0357 INFO | 
2017-01-13 18:10:08,114 job              L0371 INFO | Temporary dir: /var/tmp/avocado_wOUEbA
2017-01-13 18:10:08,114 job              L0372 INFO | 
2017-01-13 18:10:08,114 job              L0379 INFO | Variant 1:    /
2017-01-13 18:10:08,114 job              L0382 INFO | 
2017-01-13 18:10:08,114 job              L0291 INFO | Job ID: 72d31cec8472f775b861e9e772b729104595dad3
2017-01-13 18:10:08,114 job              L0294 INFO | 
2017-01-13 18:10:08,177 sysinfo          L0107 DEBUG| Not logging /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor (file does not exist)
2017-01-13 18:10:08,280 sysinfo          L0107 DEBUG| Not logging /proc/pci (file does not exist)
2017-01-13 18:10:08,307 sysinfo          L0105 DEBUG| Not logging /proc/slabinfo (lack of permissions)
2017-01-13 18:10:08,318 sysinfo          L0107 DEBUG| Not logging /sys/kernel/debug/sched_features (file does not exist)
2017-01-13 18:10:08,449 sysinfo          L0388 INFO | Commands configured by file: /etc/avocado/sysinfo/commands
2017-01-13 18:10:08,450 sysinfo          L0399 INFO | Files configured by file: /etc/avocado/sysinfo/files
2017-01-13 18:10:08,450 sysinfo          L0419 INFO | Profilers configured by file: /etc/avocado/sysinfo/profilers
2017-01-13 18:10:08,450 sysinfo          L0427 INFO | Profiler disabled
2017-01-13 18:10:08,458 multiplexer      L0168 DEBUG| PARAMS (key=timeout, path=*, default=None) => None
2017-01-13 18:10:08,458 test             L0217 INFO | START 1-tests/test.py:MinishiftISOTest.test_boot_vm_out_of_iso
2017-01-13 18:10:08,720 test             L0017 INFO | ################################################################
2017-01-13 18:10:08,720 test             L0018 INFO | Avocado version : 43.0
2017-01-13 18:10:08,720 test             L0019 INFO | ################################################################
2017-01-13 18:10:08,720 stacktrace       L0038 ERROR| 
2017-01-13 18:10:08,720 stacktrace       L0041 ERROR| Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado/core/test.py:436
2017-01-13 18:10:08,721 stacktrace       L0044 ERROR| Traceback (most recent call last):
2017-01-13 18:10:08,721 stacktrace       L0044 ERROR|   File "/home/prkumar/github/minishift-b2d-iso/tests/test.py", line 30, in setUp
2017-01-13 18:10:08,721 stacktrace       L0044 ERROR|     self.skip("Skipping testing as no ISO found in 'build' directory.")
2017-01-13 18:10:08,721 stacktrace       L0044 ERROR|   File "/usr/lib/python2.7/site-packages/avocado/core/test.py", line 638, in skip
2017-01-13 18:10:08,721 stacktrace       L0044 ERROR|     raise exceptions.TestSkipError(message)
2017-01-13 18:10:08,721 stacktrace       L0044 ERROR| TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,721 stacktrace       L0045 ERROR| 
2017-01-13 18:10:08,721 test             L0593 ERROR| SKIP 1-tests/test.py:MinishiftISOTest.test_boot_vm_out_of_iso -> TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,721 test             L0580 INFO | 
2017-01-13 18:10:08,763 sysinfo          L0388 INFO | Commands configured by file: /etc/avocado/sysinfo/commands
2017-01-13 18:10:08,763 sysinfo          L0399 INFO | Files configured by file: /etc/avocado/sysinfo/files
2017-01-13 18:10:08,764 sysinfo          L0419 INFO | Profilers configured by file: /etc/avocado/sysinfo/profilers
2017-01-13 18:10:08,764 sysinfo          L0427 INFO | Profiler disabled
2017-01-13 18:10:08,771 multiplexer      L0168 DEBUG| PARAMS (key=timeout, path=*, default=None) => None
2017-01-13 18:10:08,771 test             L0217 INFO | START 2-tests/test.py:MinishiftISOTest.test_ssh_connection_to_vm
2017-01-13 18:10:08,811 test             L0017 INFO | ################################################################
2017-01-13 18:10:08,811 test             L0018 INFO | Avocado version : 43.0
2017-01-13 18:10:08,811 test             L0019 INFO | ################################################################
2017-01-13 18:10:08,811 stacktrace       L0038 ERROR| 
2017-01-13 18:10:08,811 stacktrace       L0041 ERROR| Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado/core/test.py:436
2017-01-13 18:10:08,812 stacktrace       L0044 ERROR| Traceback (most recent call last):
2017-01-13 18:10:08,812 stacktrace       L0044 ERROR|   File "/home/prkumar/github/minishift-b2d-iso/tests/test.py", line 30, in setUp
2017-01-13 18:10:08,812 stacktrace       L0044 ERROR|     self.skip("Skipping testing as no ISO found in 'build' directory.")
2017-01-13 18:10:08,812 stacktrace       L0044 ERROR|   File "/usr/lib/python2.7/site-packages/avocado/core/test.py", line 638, in skip
2017-01-13 18:10:08,812 stacktrace       L0044 ERROR|     raise exceptions.TestSkipError(message)
2017-01-13 18:10:08,812 stacktrace       L0044 ERROR| TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,812 stacktrace       L0045 ERROR| 
2017-01-13 18:10:08,812 test             L0593 ERROR| SKIP 2-tests/test.py:MinishiftISOTest.test_ssh_connection_to_vm -> TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,813 test             L0580 INFO | 
2017-01-13 18:10:08,854 sysinfo          L0388 INFO | Commands configured by file: /etc/avocado/sysinfo/commands
2017-01-13 18:10:08,854 sysinfo          L0399 INFO | Files configured by file: /etc/avocado/sysinfo/files
2017-01-13 18:10:08,855 sysinfo          L0419 INFO | Profilers configured by file: /etc/avocado/sysinfo/profilers
2017-01-13 18:10:08,855 sysinfo          L0427 INFO | Profiler disabled
2017-01-13 18:10:08,862 multiplexer      L0168 DEBUG| PARAMS (key=timeout, path=*, default=None) => None
2017-01-13 18:10:08,862 test             L0217 INFO | START 3-tests/test.py:MinishiftISOTest.test_ip_of_vm
2017-01-13 18:10:08,896 test             L0017 INFO | ################################################################
2017-01-13 18:10:08,897 test             L0018 INFO | Avocado version : 43.0
2017-01-13 18:10:08,897 test             L0019 INFO | ################################################################
2017-01-13 18:10:08,897 stacktrace       L0038 ERROR| 
2017-01-13 18:10:08,897 stacktrace       L0041 ERROR| Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado/core/test.py:436
2017-01-13 18:10:08,897 stacktrace       L0044 ERROR| Traceback (most recent call last):
2017-01-13 18:10:08,897 stacktrace       L0044 ERROR|   File "/home/prkumar/github/minishift-b2d-iso/tests/test.py", line 30, in setUp
2017-01-13 18:10:08,897 stacktrace       L0044 ERROR|     self.skip("Skipping testing as no ISO found in 'build' directory.")
2017-01-13 18:10:08,898 stacktrace       L0044 ERROR|   File "/usr/lib/python2.7/site-packages/avocado/core/test.py", line 638, in skip
2017-01-13 18:10:08,898 stacktrace       L0044 ERROR|     raise exceptions.TestSkipError(message)
2017-01-13 18:10:08,898 stacktrace       L0044 ERROR| TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,898 stacktrace       L0045 ERROR| 
2017-01-13 18:10:08,898 test             L0593 ERROR| SKIP 3-tests/test.py:MinishiftISOTest.test_ip_of_vm -> TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,898 test             L0580 INFO | 
2017-01-13 18:10:08,934 sysinfo          L0388 INFO | Commands configured by file: /etc/avocado/sysinfo/commands
2017-01-13 18:10:08,934 sysinfo          L0399 INFO | Files configured by file: /etc/avocado/sysinfo/files
2017-01-13 18:10:08,934 sysinfo          L0419 INFO | Profilers configured by file: /etc/avocado/sysinfo/profilers
2017-01-13 18:10:08,935 sysinfo          L0427 INFO | Profiler disabled
2017-01-13 18:10:08,941 multiplexer      L0168 DEBUG| PARAMS (key=timeout, path=*, default=None) => None
2017-01-13 18:10:08,942 test             L0217 INFO | START 4-tests/test.py:MinishiftISOTest.test_docker_env_evaluable
2017-01-13 18:10:08,982 test             L0017 INFO | ################################################################
2017-01-13 18:10:08,982 test             L0018 INFO | Avocado version : 43.0
2017-01-13 18:10:08,982 test             L0019 INFO | ################################################################
2017-01-13 18:10:08,983 stacktrace       L0038 ERROR| 
2017-01-13 18:10:08,983 stacktrace       L0041 ERROR| Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado/core/test.py:436
2017-01-13 18:10:08,983 stacktrace       L0044 ERROR| Traceback (most recent call last):
2017-01-13 18:10:08,983 stacktrace       L0044 ERROR|   File "/home/prkumar/github/minishift-b2d-iso/tests/test.py", line 30, in setUp
2017-01-13 18:10:08,983 stacktrace       L0044 ERROR|     self.skip("Skipping testing as no ISO found in 'build' directory.")
2017-01-13 18:10:08,983 stacktrace       L0044 ERROR|   File "/usr/lib/python2.7/site-packages/avocado/core/test.py", line 638, in skip
2017-01-13 18:10:08,983 stacktrace       L0044 ERROR|     raise exceptions.TestSkipError(message)
2017-01-13 18:10:08,984 stacktrace       L0044 ERROR| TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,984 stacktrace       L0045 ERROR| 
2017-01-13 18:10:08,984 test             L0593 ERROR| SKIP 4-tests/test.py:MinishiftISOTest.test_docker_env_evaluable -> TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:08,984 test             L0580 INFO | 
2017-01-13 18:10:09,036 sysinfo          L0388 INFO | Commands configured by file: /etc/avocado/sysinfo/commands
2017-01-13 18:10:09,036 sysinfo          L0399 INFO | Files configured by file: /etc/avocado/sysinfo/files
2017-01-13 18:10:09,036 sysinfo          L0419 INFO | Profilers configured by file: /etc/avocado/sysinfo/profilers
2017-01-13 18:10:09,036 sysinfo          L0427 INFO | Profiler disabled
2017-01-13 18:10:09,044 multiplexer      L0168 DEBUG| PARAMS (key=timeout, path=*, default=None) => None
2017-01-13 18:10:09,044 test             L0217 INFO | START 5-tests/test.py:MinishiftISOTest.test_stopping_vm
2017-01-13 18:10:09,085 test             L0017 INFO | ################################################################
2017-01-13 18:10:09,085 test             L0018 INFO | Avocado version : 43.0
2017-01-13 18:10:09,085 test             L0019 INFO | ################################################################
2017-01-13 18:10:09,086 stacktrace       L0038 ERROR| 
2017-01-13 18:10:09,086 stacktrace       L0041 ERROR| Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado/core/test.py:436
2017-01-13 18:10:09,086 stacktrace       L0044 ERROR| Traceback (most recent call last):
2017-01-13 18:10:09,086 stacktrace       L0044 ERROR|   File "/home/prkumar/github/minishift-b2d-iso/tests/test.py", line 30, in setUp
2017-01-13 18:10:09,086 stacktrace       L0044 ERROR|     self.skip("Skipping testing as no ISO found in 'build' directory.")
2017-01-13 18:10:09,086 stacktrace       L0044 ERROR|   File "/usr/lib/python2.7/site-packages/avocado/core/test.py", line 638, in skip
2017-01-13 18:10:09,086 stacktrace       L0044 ERROR|     raise exceptions.TestSkipError(message)
2017-01-13 18:10:09,087 stacktrace       L0044 ERROR| TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:09,087 stacktrace       L0045 ERROR| 
2017-01-13 18:10:09,087 test             L0593 ERROR| SKIP 5-tests/test.py:MinishiftISOTest.test_stopping_vm -> TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:09,087 test             L0580 INFO | 
2017-01-13 18:10:09,128 sysinfo          L0388 INFO | Commands configured by file: /etc/avocado/sysinfo/commands
2017-01-13 18:10:09,129 sysinfo          L0399 INFO | Files configured by file: /etc/avocado/sysinfo/files
2017-01-13 18:10:09,129 sysinfo          L0419 INFO | Profilers configured by file: /etc/avocado/sysinfo/profilers
2017-01-13 18:10:09,129 sysinfo          L0427 INFO | Profiler disabled
2017-01-13 18:10:09,136 multiplexer      L0168 DEBUG| PARAMS (key=timeout, path=*, default=None) => None
2017-01-13 18:10:09,136 test             L0217 INFO | START 6-tests/test.py:MinishiftISOTest.test_delete_vm
2017-01-13 18:10:09,189 test             L0017 INFO | ################################################################
2017-01-13 18:10:09,189 test             L0018 INFO | Avocado version : 43.0
2017-01-13 18:10:09,190 test             L0019 INFO | ################################################################
2017-01-13 18:10:09,190 stacktrace       L0038 ERROR| 
2017-01-13 18:10:09,190 stacktrace       L0041 ERROR| Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado/core/test.py:436
2017-01-13 18:10:09,190 stacktrace       L0044 ERROR| Traceback (most recent call last):
2017-01-13 18:10:09,190 stacktrace       L0044 ERROR|   File "/home/prkumar/github/minishift-b2d-iso/tests/test.py", line 30, in setUp
2017-01-13 18:10:09,191 stacktrace       L0044 ERROR|     self.skip("Skipping testing as no ISO found in 'build' directory.")
2017-01-13 18:10:09,191 stacktrace       L0044 ERROR|   File "/usr/lib/python2.7/site-packages/avocado/core/test.py", line 638, in skip
2017-01-13 18:10:09,191 stacktrace       L0044 ERROR|     raise exceptions.TestSkipError(message)
2017-01-13 18:10:09,191 stacktrace       L0044 ERROR| TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:09,191 stacktrace       L0045 ERROR| 
2017-01-13 18:10:09,191 test             L0593 ERROR| SKIP 6-tests/test.py:MinishiftISOTest.test_delete_vm -> TestSkipError: Skipping testing as no ISO found in 'build' directory.
2017-01-13 18:10:09,191 test             L0580 INFO | 
2017-01-13 18:10:09,254 sysinfo          L0107 DEBUG| Not logging /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor (file does not exist)
2017-01-13 18:10:09,271 sysinfo          L0107 DEBUG| Not logging /proc/pci (file does not exist)
2017-01-13 18:10:09,279 sysinfo          L0105 DEBUG| Not logging /proc/slabinfo (lack of permissions)
2017-01-13 18:10:09,284 sysinfo          L0107 DEBUG| Not logging /sys/kernel/debug/sched_features (file does not exist)
2017-01-13 18:10:09,317 job              L0457 INFO | Test results available in /home/prkumar/avocado/job-results/job-2017-01-13T18.10-72d31ce

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 16, 2017

@praveenkumar , It seems you missed on step here before running make test.

You need to run make iso before make test. The tests assume that ISO is already available.
See the error below at the end of logs.

TestSkipError: Skipping testing as no ISO found in 'build' directory.

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 17, 2017

retest this please

2 similar comments
@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 17, 2017

retest this please

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 17, 2017

retest this please

@praveenkumar
Copy link
Contributor

Tested and worked as expected 👍

$ make test
Downloading latest minishift binary...
######################################################################## 100.0%
Done.
avocado run  tests/test.py
JOB ID     : 27c99a0025c7c1b81c95b20821a8666b54a32da1
JOB LOG    : /home/prkumar/avocado/job-results/job-2017-01-17T10.47-27c99a0/job.log
TESTS      : 6
 (1/6) tests/test.py:MinishiftISOTest.test_boot_vm_out_of_iso: PASS (102.61 s)
 (2/6) tests/test.py:MinishiftISOTest.test_ssh_connection_to_vm: PASS (0.16 s)
 (3/6) tests/test.py:MinishiftISOTest.test_ip_of_vm: PASS (0.06 s)
 (4/6) tests/test.py:MinishiftISOTest.test_docker_env_evaluable: PASS (0.07 s)
 (5/6) tests/test.py:MinishiftISOTest.test_stopping_vm: PASS (1.44 s)
 (6/6) tests/test.py:MinishiftISOTest.test_delete_vm: PASS (0.27 s)
RESULTS    : PASS 6 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0
TESTS TIME : 104.61 s

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 17, 2017

retest this please

2 similar comments
@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 17, 2017

retest this please

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 18, 2017

retest this please

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 18, 2017

@hferentschik Tests are passing in ci.centos and ready to merge now.

Once, it is merged will put similar tests for centos-iso repo here minishift/minishift-centos-iso#80

Copy link
Member

@hferentschik hferentschik left a comment

Choose a reason for hiding this comment

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

I still cannot see which targets would clean the BIN_DIR and hence minishift. It is part of the test install, so there should be a way to clean it as well.

Also, there seems to be still at least one place where tests becomes OS specific. At some stage I'd like to run these tests locally as well.

That said, I am ok to merge this to make some progress.

self.repo_dir = os.path.dirname(os.path.realpath(__file__)) + "/.."
self.scripts_dir = self.repo_dir + "/tests/"
self.bin_dir = self.repo_dir + "/build/bin/"
self.driver_name = 'kvm'
Copy link
Member

Choose a reason for hiding this comment

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

So what is the reply to this? For now only CentOS and Linux, right?

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 18, 2017

So what is the reply to this? For now only CentOS and Linux, right?

Yes @hferentschik

@coolbrg
Copy link
Contributor Author

coolbrg commented Jan 18, 2017

I still cannot see which targets would clean the BIN_DIR and hence minishift. It is part of the test install, so there should be a way to clean it as well.

I have added BIN_DIR as part of BUILD_DIR which is being cleaned via clean target. Since iso is also part of build dir, make clean will clean BUILD_DIR and hence BIN_DIR

@hferentschik
Copy link
Member

I have added BIN_DIR as part of BUILD_DIR which is being cleaned via clean target. Since iso is also part of build dir, make clean will clean BUILD_DIR and hence BIN_DIR

Got you. +1

@hferentschik hferentschik merged commit 19a0953 into minishift:master Jan 18, 2017
@hferentschik
Copy link
Member

Merged, thanks

@coolbrg coolbrg deleted the fix-5 branch January 18, 2017 14:29
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.

5 participants