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

[WIP] Kitchen.ci test environment #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ __ipmininet_temp_key.pub
tags
.eggs
*.ropeproject
.kitchen/
.kitchen.local.yml
19 changes: 19 additions & 0 deletions kitchen.openr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
driver:
name: vagrant
synced_folders:
- [".", "/opt/ipmininet"]
customize:
memory: 4096

provisioner:
name: shell
command: /opt/ipmininet/util/build_vm.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
command: /opt/ipmininet/util/build_vm.sh
command: /opt/ipmininet/util/build_vm.sh && sudo pytest -v /opt/ipmininet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kitchen supplies a config section (verifiers) for running tests https://kitchen.ci/docs/getting-started/writing-test/. Separating the provisioning and the tests. I suggest adding the tests there.


platforms:
- name: ubuntu-16.04

suites:
- name: default
run_list:
attributes:
19 changes: 19 additions & 0 deletions kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
driver:
name: vagrant
synced_folders:
- [".", "/opt/ipmininet"]

provisioner:
name: shell
command: sudo python /opt/ipmininet/util/install.py -a
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
command: sudo python /opt/ipmininet/util/install.py -a
command: if which apt; then sudo apt install -y python; elif which yum; then sudo yum install -y python; fi; sudo python /opt/ipmininet/util/install.py -iam && sudo pytest -v /opt/ipmininet

Copy link
Collaborator

Choose a reason for hiding this comment

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

This solves the problems for all platforms

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 for if which apt; then sudo apt install -y python; elif which yum; then sudo yum install -y python; fi; sudo python /opt/ipmininet/util/install.py -iam

For sudo pytest -v /opt/ipmininet see #31 (comment)


platforms:
- name: ubuntu-16.04
- name: debian-9
- name: fedora-28

suites:
- name: default
run_list:
attributes:
2 changes: 2 additions & 0 deletions util/install.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is not needed, I think
I would remove it


import argparse
import os
import sys
Expand Down