summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
l---------spec/ospf/Vagrantfile1
-rw-r--r--spec/ospf/config.yaml15
-rw-r--r--spec/ospf/vyos1_script.sh14
-rw-r--r--spec/ospf/vyos1_spec.rb6
-rw-r--r--spec/ospf/vyos2_script.sh14
-rw-r--r--spec/ospf/vyos2_spec.rb6
-rw-r--r--spec/ospf/vyos3_script.sh12
-rw-r--r--spec/ospf/vyos3_spec.rb13
-rw-r--r--spec/ospf/vyos4_script.sh12
-rw-r--r--spec/ospf/vyos4_spec.rb13
10 files changed, 106 insertions, 0 deletions
diff --git a/spec/ospf/Vagrantfile b/spec/ospf/Vagrantfile
new file mode 120000
index 0000000..2572fa2
--- /dev/null
+++ b/spec/ospf/Vagrantfile
@@ -0,0 +1 @@
+../../Vagrantfile \ No newline at end of file
diff --git a/spec/ospf/config.yaml b/spec/ospf/config.yaml
new file mode 100644
index 0000000..b46047f
--- /dev/null
+++ b/spec/ospf/config.yaml
@@ -0,0 +1,15 @@
+---
+vyos1:
+ :networks:
+ net1: "10.0.1.11/24"
+ net2: "10.0.2.11/24"
+vyos2:
+ :networks:
+ net1: "10.0.1.12/24"
+ net3: "10.0.3.12/24"
+vyos3:
+ :networks:
+ net2: "10.0.2.13/24"
+vyos4:
+ :networks:
+ net3: "10.0.3.14/24"
diff --git a/spec/ospf/vyos1_script.sh b/spec/ospf/vyos1_script.sh
new file mode 100644
index 0000000..65b1c05
--- /dev/null
+++ b/spec/ospf/vyos1_script.sh
@@ -0,0 +1,14 @@
+#!/bin/vbash
+
+if [ "$(id -g -n)" != 'vyattacfg' ] ; then
+ exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
+fi
+
+source /opt/vyatta/etc/functions/script-template
+
+set protocols ospf area 0.0.0.0 network 10.0.1.0/24
+set protocols ospf area 0.0.0.0 network 10.0.2.0/24
+set protocols ospf passive-interface eth2
+
+commit
+save
diff --git a/spec/ospf/vyos1_spec.rb b/spec/ospf/vyos1_spec.rb
new file mode 100644
index 0000000..e46d107
--- /dev/null
+++ b/spec/ospf/vyos1_spec.rb
@@ -0,0 +1,6 @@
+require_relative '../spec_helper'
+require_relative '../config_spec'
+
+describe 'vyos1_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/ospf/vyos2_script.sh b/spec/ospf/vyos2_script.sh
new file mode 100644
index 0000000..fe448f2
--- /dev/null
+++ b/spec/ospf/vyos2_script.sh
@@ -0,0 +1,14 @@
+#!/bin/vbash
+
+if [ "$(id -g -n)" != 'vyattacfg' ] ; then
+ exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
+fi
+
+source /opt/vyatta/etc/functions/script-template
+
+set protocols ospf area 0.0.0.0 network 10.0.1.0/24
+set protocols ospf area 0.0.0.0 network 10.0.3.0/24
+set protocols ospf passive-interface eth2
+
+commit
+save
diff --git a/spec/ospf/vyos2_spec.rb b/spec/ospf/vyos2_spec.rb
new file mode 100644
index 0000000..2c5b45e
--- /dev/null
+++ b/spec/ospf/vyos2_spec.rb
@@ -0,0 +1,6 @@
+require_relative '../spec_helper'
+require_relative '../config_spec'
+
+describe 'vyos2_config' do
+ include_examples 'config_spec'
+end
diff --git a/spec/ospf/vyos3_script.sh b/spec/ospf/vyos3_script.sh
new file mode 100644
index 0000000..3db2539
--- /dev/null
+++ b/spec/ospf/vyos3_script.sh
@@ -0,0 +1,12 @@
+#!/bin/vbash
+
+if [ "$(id -g -n)" != 'vyattacfg' ] ; then
+ exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
+fi
+
+source /opt/vyatta/etc/functions/script-template
+
+set protocols static route 10.0.3.0/24 next-hop 10.0.2.11
+
+commit
+save
diff --git a/spec/ospf/vyos3_spec.rb b/spec/ospf/vyos3_spec.rb
new file mode 100644
index 0000000..372a285
--- /dev/null
+++ b/spec/ospf/vyos3_spec.rb
@@ -0,0 +1,13 @@
+require_relative '../spec_helper'
+require_relative '../config_spec'
+
+describe 'vyos3_config' do
+ include_examples 'config_spec'
+end
+
+# Wait for advertising
+sleep(60)
+
+describe host('10.0.3.14') do
+ it { should be_reachable.with(timeout: 10) }
+end
diff --git a/spec/ospf/vyos4_script.sh b/spec/ospf/vyos4_script.sh
new file mode 100644
index 0000000..42b239e
--- /dev/null
+++ b/spec/ospf/vyos4_script.sh
@@ -0,0 +1,12 @@
+#!/bin/vbash
+
+if [ "$(id -g -n)" != 'vyattacfg' ] ; then
+ exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
+fi
+
+source /opt/vyatta/etc/functions/script-template
+
+set protocols static route 10.0.2.0/24 next-hop 10.0.3.12
+
+commit
+save
diff --git a/spec/ospf/vyos4_spec.rb b/spec/ospf/vyos4_spec.rb
new file mode 100644
index 0000000..692a456
--- /dev/null
+++ b/spec/ospf/vyos4_spec.rb
@@ -0,0 +1,13 @@
+require_relative '../spec_helper'
+require_relative '../config_spec'
+
+describe 'vyos4_config' do
+ include_examples 'config_spec'
+end
+
+# Wait for advertising
+sleep(40)
+
+describe host('10.0.2.13') do
+ it { should be_reachable.with(timeout: 10) }
+end