This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from nanliu/e2e
Add end to end large tests with plugin tasks
- Loading branch information
Showing
4 changed files
with
76 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# NOTE: override this via the option --provider {provider_name} | ||
ENV["VAGRANT_DEFAULT_PROVIDER"] = "virtualbox" | ||
|
||
Vagrant.configure(2) do |config| | ||
operating_systems = %w{ centos72 } | ||
|
||
operating_systems.each do |os| | ||
config.vm.define os do |system| | ||
system.vm.box = "boxcutter/#{os}" | ||
|
||
$script = <<SCRIPT | ||
curl -sfL https://raw.githubusercontent.com/intelsdi-x/snap-docker/master/install_snap | sudo bash | ||
curl -sfL https://raw.githubusercontent.com/intelsdi-x/snap-docker/master/snapd.conf -o /etc/snap/snapd.conf | ||
curl -sfL https://s3-us-west-2.amazonaws.com/snap.ci.snap-telemetry.io/plugins/snap-plugin-collector-ethtool/master/latest/linux/x86_64/snap-plugin-collector-ethtool -o /opt/snap/plugins/snap-plugin-collector-ethtool | ||
curl -sfL https://s3-us-west-2.amazonaws.com/snap.ci.snap-telemetry.io/plugins/snap-plugin-publisher-file/master/latest/linux/x86_64/snap-plugin-publisher-file -o /opt/snap/plugins/snap-plugin-publisher-file | ||
sudo /opt/snap/bin/snapd -t 0 -l 1 & | ||
echo 'snap provision complete' | ||
SCRIPT | ||
|
||
config.vm.provision :shell, inline: $script | ||
|
||
if Vagrant.has_plugin?("vagrant-serverspec") | ||
config.vm.provision :serverspec do |spec| | ||
spec.pattern = "spec/ethtool_spec.rb" | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'spec_helper' | ||
|
||
describe command("/opt/snap/bin/snapctl plugin load /opt/snap/plugins/snap-plugin-publisher-file") do | ||
its(:exit_status) { should eq 0 } | ||
end | ||
|
||
describe command("/opt/snap/bin/snapctl plugin load /opt/snap/plugins/snap-plugin-collector-ethtool") do | ||
its(:exit_status) { should eq 0 } | ||
end | ||
|
||
describe command("/opt/snap/bin/snapctl plugin list") do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should match /file/ } | ||
its(:stdout) { should match /ethtool/ } | ||
end | ||
|
||
describe command("/opt/snap/bin/snapctl task create -t /vagrant/examples/tasks/ethtool-file.json") do | ||
its(:exit_status) { should eq 0 } | ||
end | ||
|
||
# NOTE: need some time to populate task | ||
describe command("sleep 10") do | ||
its(:exit_status) { should eq 0 } | ||
end | ||
|
||
describe file("/tmp/published_netstats") do | ||
it { should be_file } | ||
its(:content) { should match /rx_bytes/ } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RSpec.configure do |config| | ||
config.color = true | ||
config.tty = true | ||
config.formatter = :documentation # :progress, :html, :textmate | ||
end |