summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuya Kusakabe <yuya.kusakabe@gmail.com>2017-08-02 23:23:12 +0900
committerYuya Kusakabe <yuya.kusakabe@gmail.com>2017-08-02 23:23:12 +0900
commitb9775945bbd1d45fa63dd74ebf7c566cce49b901 (patch)
treeab3d76902433cdea64db959ca3bc0e34ddf32767
parent5b101547b3c0c7d7f78d8a6a15ecee361b2349d4 (diff)
downloadvyos-integration-test-b9775945bbd1d45fa63dd74ebf7c566cce49b901.tar.gz
vyos-integration-test-b9775945bbd1d45fa63dd74ebf7c566cce49b901.zip
Use include_examples for config_spec
-rw-r--r--spec/bgp4/vyos1_spec.rb4
-rw-r--r--spec/bgp4/vyos2_spec.rb4
-rw-r--r--spec/bgp4/vyos3_spec.rb4
-rw-r--r--spec/bgp4/vyos4_spec.rb4
-rw-r--r--spec/bgp6/vyos1_spec.rb4
-rw-r--r--spec/bgp6/vyos2_spec.rb4
-rw-r--r--spec/bgp6/vyos3_spec.rb4
-rw-r--r--spec/bgp6/vyos4_spec.rb4
-rw-r--r--spec/config_spec.rb2
-rw-r--r--spec/one_node/vyos_spec.rb4
-rw-r--r--spec/site_to_site_vpn/vyos1_spec.rb4
-rw-r--r--spec/site_to_site_vpn/vyos2_spec.rb4
-rw-r--r--spec/site_to_site_vpn/vyos3_spec.rb4
-rw-r--r--spec/site_to_site_vpn/vyos4_spec.rb4
14 files changed, 40 insertions, 14 deletions
diff --git a/spec/bgp4/vyos1_spec.rb b/spec/bgp4/vyos1_spec.rb
index 76740d4..e46d107 100644
--- a/spec/bgp4/vyos1_spec.rb
+++ b/spec/bgp4/vyos1_spec.rb
@@ -1,4 +1,6 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos1_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/bgp4/vyos2_spec.rb b/spec/bgp4/vyos2_spec.rb
index 76740d4..2c5b45e 100644
--- a/spec/bgp4/vyos2_spec.rb
+++ b/spec/bgp4/vyos2_spec.rb
@@ -1,4 +1,6 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos2_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/bgp4/vyos3_spec.rb b/spec/bgp4/vyos3_spec.rb
index f4ae8b6..0754f2e 100644
--- a/spec/bgp4/vyos3_spec.rb
+++ b/spec/bgp4/vyos3_spec.rb
@@ -1,7 +1,9 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos3_config' do
+ include_examples 'config_spec'
+end
# Wait for advertising
sleep(10)
diff --git a/spec/bgp4/vyos4_spec.rb b/spec/bgp4/vyos4_spec.rb
index 770fbd6..393d2b6 100644
--- a/spec/bgp4/vyos4_spec.rb
+++ b/spec/bgp4/vyos4_spec.rb
@@ -1,7 +1,9 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos4_config' do
+ include_examples 'config_spec'
+end
# Wait for advertising
sleep(10)
diff --git a/spec/bgp6/vyos1_spec.rb b/spec/bgp6/vyos1_spec.rb
index 76740d4..e46d107 100644
--- a/spec/bgp6/vyos1_spec.rb
+++ b/spec/bgp6/vyos1_spec.rb
@@ -1,4 +1,6 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos1_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/bgp6/vyos2_spec.rb b/spec/bgp6/vyos2_spec.rb
index 76740d4..2c5b45e 100644
--- a/spec/bgp6/vyos2_spec.rb
+++ b/spec/bgp6/vyos2_spec.rb
@@ -1,4 +1,6 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos2_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/bgp6/vyos3_spec.rb b/spec/bgp6/vyos3_spec.rb
index ddcbb9b..94e31a6 100644
--- a/spec/bgp6/vyos3_spec.rb
+++ b/spec/bgp6/vyos3_spec.rb
@@ -1,7 +1,9 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos3_config' do
+ include_examples 'config_spec'
+end
# Wait for advertising
sleep(10)
diff --git a/spec/bgp6/vyos4_spec.rb b/spec/bgp6/vyos4_spec.rb
index 3f0cde7..6161b92 100644
--- a/spec/bgp6/vyos4_spec.rb
+++ b/spec/bgp6/vyos4_spec.rb
@@ -1,7 +1,9 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos4_config' do
+ include_examples 'config_spec'
+end
# Wait for advertising
sleep(10)
diff --git a/spec/config_spec.rb b/spec/config_spec.rb
index f9b3980..dc9edd8 100644
--- a/spec/config_spec.rb
+++ b/spec/config_spec.rb
@@ -1,6 +1,6 @@
require 'serverspec_vyos_config'
-def config_spec
+shared_examples_for 'config_spec' do
test = ENV['TARGET_TEST']
host = ENV['TARGET_HOST']
diff --git a/spec/one_node/vyos_spec.rb b/spec/one_node/vyos_spec.rb
index 76740d4..fca7fe7 100644
--- a/spec/one_node/vyos_spec.rb
+++ b/spec/one_node/vyos_spec.rb
@@ -1,4 +1,6 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/site_to_site_vpn/vyos1_spec.rb b/spec/site_to_site_vpn/vyos1_spec.rb
index 76740d4..e46d107 100644
--- a/spec/site_to_site_vpn/vyos1_spec.rb
+++ b/spec/site_to_site_vpn/vyos1_spec.rb
@@ -1,4 +1,6 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos1_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/site_to_site_vpn/vyos2_spec.rb b/spec/site_to_site_vpn/vyos2_spec.rb
index 76740d4..2c5b45e 100644
--- a/spec/site_to_site_vpn/vyos2_spec.rb
+++ b/spec/site_to_site_vpn/vyos2_spec.rb
@@ -1,4 +1,6 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos2_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/site_to_site_vpn/vyos3_spec.rb b/spec/site_to_site_vpn/vyos3_spec.rb
index 6f67d61..cfabd10 100644
--- a/spec/site_to_site_vpn/vyos3_spec.rb
+++ b/spec/site_to_site_vpn/vyos3_spec.rb
@@ -1,7 +1,9 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos3_config' do
+ include_examples 'config_spec'
+end
describe host('10.0.3.14') do
it { should be_reachable }
diff --git a/spec/site_to_site_vpn/vyos4_spec.rb b/spec/site_to_site_vpn/vyos4_spec.rb
index b657b9e..e9937a4 100644
--- a/spec/site_to_site_vpn/vyos4_spec.rb
+++ b/spec/site_to_site_vpn/vyos4_spec.rb
@@ -1,7 +1,9 @@
require_relative '../spec_helper'
require_relative '../config_spec'
-config_spec
+describe 'vyos4_config' do
+ include_examples 'config_spec'
+end
describe host('10.0.2.13') do
it { should be_reachable }