SlideShare a Scribd company logo
1
Network Test Automation
@otahi
2015-10-30
Net Ops Coding #1
2
Self Introduction
● @otahi
– A network engineer?
● Trying to be an SDN engineer
● Charged in (mainly) DC internal network
– Programmer
● Weekends and early mornings only + Weekdays
– Favorite language
● Ruby
3
Net Ops + Coding?
● SDN
– OpenFlow
– OpenStack
● Configuration automation
– NETCONF
– Rest API
– SSH
● Test automation
– RSpec
4
Test Automation
● “Test automation” gives:
– Confidence to change
– Reducing double checks!!
● Difficulties?:
– Old network devices? → No problem
– No time to change → No problem
– Intermediate states? → No problem
– Affects network connectivity? → No problem
✔
✔
✔
✔
5
How to Test?
● You can test your network with tools
– Language: Ruby
– Test framework: RSpec
– Target servers: No Ruby needed
Testing server
Target server 1
Target server 2
Ruby & RSpec
tooltooltooltool
SSH/HTTP(S)/DNS
Target network
6
Test Tools
Type Test target Remarks
Serverspec Servers(static)
Infrataster Servers(dynamic)
Infrataster-plugin-dns
(Rspec-dns)
DNS servers
Infrataster-plugin-firewall Firewalls Traget server needs:
tcpdump, netcat
Lbspec Load Balancers(L4-L7) Target server needs:
ngrep, netcat
Rspec-ssltls SSL/TLS
7
Serverspec
describe host('target.example.jp') do
# ping
it { should be_reachable }
# tcp port 22
it { should be_reachable.with( port: 22 ) }
# set protocol explicitly
it { should be_reachable.with( port: 22, proto: 'tcp' ) }
end
8
Infrataster-plugin-dns
describe server(:dns) do
describe dns('www.example.com') do
it do
is_expected.to have_entry.with_type('A')
.and_address('192.0.2.4')
end
end
describe dns('192.0.2.4') do
it do
is_expected.to have_entry.with_type('PTR')
.and_domainname('www.example.com')
end
end
end
9
Infrataster-plugin-firewall
describe server(:src) do
describe firewall(server(:dst)) do
it { is_expected.to be_reachable }
it { is_expected.to be_reachable.dest_port(80) }
it { is_expected.to be_reachable.tcp.dest_port(80) }
it { is_expected.to be_reachable.udp.dest_port(53) }
end
end
10
Lbspec
describe 'vhost_c:80' do
it { should transfer(['node_b', 'node_c']])).port(80) }
it { should respond('404') }
end
describe 'loadbalancer' do
it do should healthcheck('node_c')
.include('/test/healthcheck').from('192.168.1.10')
end
end
11
Rspec-ssltls
describe 'www.example.com:443' do
it do
is_expected.to have_certificate
.subject(CN: '*.example.com').valid_at('2020/09/12 19:00:05 JST')
end
it { is_expected.to support_protocol('TLSv1_2') }
it { is_expected.to support_cipher('AES256-SHA').protocol('TLSv1') }
it { is_expected.to support_cipher('DES-CBC3-SHA').protocol('SSLv3') }
it do
is_expected.to choose_cipher('DES-CBC3-SHA')
.protocol('TLSv1')
.from(['AES256-SHA', 'AES128-SHA', 'DES-CBC3-SHA'])
end
end
12
You can get test results
$ bundle exec rspec
server 'src'
via firewall
should reach to server 'dst'
should reach to server 'dst' dest_port: 80
should reach to server 'dst' tcp dest_port: 80
should reach to server 'dst' udp dest_port: 53
Finished in 15.87 seconds (files took 0.58711 seconds to load)
4 examples, 0 failures
$
13
Thank you!

More Related Content

PPTX
Implementing MPLS Services using Openflow
PDF
Ryu SDN Framework
PDF
Developing SDN apps in Ryu
PDF
Naim lighting
PPTX
RYU Introduction
PDF
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
PDF
Networking in Java with NIO and Netty
KEY
Distributed app development with nodejs and zeromq
Implementing MPLS Services using Openflow
Ryu SDN Framework
Developing SDN apps in Ryu
Naim lighting
RYU Introduction
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
Networking in Java with NIO and Netty
Distributed app development with nodejs and zeromq

What's hot (20)

PDF
PDF
p4alu: Arithmetic Logic Unit in P4
PDF
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
PPTX
Ansible x napalm x nso 解説・比較パネルディスカッション nso
PDF
netfilter programming
PDF
FreeBSD, ipfw and OpenVPN 2.1 server
PDF
Anton Moldovan "Building an efficient replication system for thousands of ter...
PDF
Возможности интерпретатора Python в NX-OS
PDF
Scalable Networking
PDF
Securing Back Office Business Processes with OpenVPN
KEY
Twisted: a quick introduction
PPTX
Commication Framework in OpenStack
PDF
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
PDF
LF_DPDK17_Lagopus Router
PDF
2015.7.17 JANOG36 BGP Flowspec Interoperability Test @ Interop Tokyo 2015 Sho...
PDF
DevConf 2014 Kernel Networking Walkthrough
PPTX
IxVM on CML
PDF
Cilium - API-aware Networking and Security for Containers based on BPF
PPTX
Asynchronous Python with Twisted
p4alu: Arithmetic Logic Unit in P4
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
Ansible x napalm x nso 解説・比較パネルディスカッション nso
netfilter programming
FreeBSD, ipfw and OpenVPN 2.1 server
Anton Moldovan "Building an efficient replication system for thousands of ter...
Возможности интерпретатора Python в NX-OS
Scalable Networking
Securing Back Office Business Processes with OpenVPN
Twisted: a quick introduction
Commication Framework in OpenStack
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
LF_DPDK17_Lagopus Router
2015.7.17 JANOG36 BGP Flowspec Interoperability Test @ Interop Tokyo 2015 Sho...
DevConf 2014 Kernel Networking Walkthrough
IxVM on CML
Cilium - API-aware Networking and Security for Containers based on BPF
Asynchronous Python with Twisted
Ad

Similar to Network Test Automation - Net Ops Coding 2015 (20)

PDF
Network Test Automation 2015-04-23 #npstudy
PDF
Run Run Trema Test
PPTX
Network testing course
PDF
The Path to a Programmable Network
PDF
Simplify Networking for Containers
PPTX
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
PDF
Reproducible Network Research With High-­Fidelity Emulation
PDF
PLNOG 13: Piotr Głaska: Quality of service monitoring in IP networks
PDF
TOGETHER: TOpology GEneration THrough HEuRistics
PDF
CCIE Devante v1.0 and Certifications and training
PDF
Automating Complex Setups with Puppet
PDF
Network Automation (Bay Area Juniper Networks Meetup)
PPT
MPLS SDN 2015 - SPRING interoperability testing
PDF
101 Labs Cisco Ccna Handson Practical Labs For The 200301 Implementing And Ad...
PDF
101 Labs Cisco Ccna Handson Practical Labs For The 200301 Implementing And Ad...
PDF
CCNP Service Provider Training and Certification
PPTX
BEST REST in OpenStack
PPTX
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
PDF
Interconnection Automation For All - Extended - MPS 2023
PDF
Ccna labs-udemy
Network Test Automation 2015-04-23 #npstudy
Run Run Trema Test
Network testing course
The Path to a Programmable Network
Simplify Networking for Containers
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Reproducible Network Research With High-­Fidelity Emulation
PLNOG 13: Piotr Głaska: Quality of service monitoring in IP networks
TOGETHER: TOpology GEneration THrough HEuRistics
CCIE Devante v1.0 and Certifications and training
Automating Complex Setups with Puppet
Network Automation (Bay Area Juniper Networks Meetup)
MPLS SDN 2015 - SPRING interoperability testing
101 Labs Cisco Ccna Handson Practical Labs For The 200301 Implementing And Ad...
101 Labs Cisco Ccna Handson Practical Labs For The 200301 Implementing And Ad...
CCNP Service Provider Training and Certification
BEST REST in OpenStack
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Interconnection Automation For All - Extended - MPS 2023
Ccna labs-udemy
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Modernizing your data center with Dell and AMD
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
cuic standard and advanced reporting.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Transforming Manufacturing operations through Intelligent Integrations
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Sensors and Actuators in IoT Systems using pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Chapter 3 Spatial Domain Image Processing.pdf
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced Soft Computing BINUS July 2025.pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Advanced methodologies resolving dimensionality complications for autism neur...
Modernizing your data center with Dell and AMD
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
cuic standard and advanced reporting.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Transforming Manufacturing operations through Intelligent Integrations
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
MYSQL Presentation for SQL database connectivity
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Sensors and Actuators in IoT Systems using pdf

Network Test Automation - Net Ops Coding 2015

  • 2. 2 Self Introduction ● @otahi – A network engineer? ● Trying to be an SDN engineer ● Charged in (mainly) DC internal network – Programmer ● Weekends and early mornings only + Weekdays – Favorite language ● Ruby
  • 3. 3 Net Ops + Coding? ● SDN – OpenFlow – OpenStack ● Configuration automation – NETCONF – Rest API – SSH ● Test automation – RSpec
  • 4. 4 Test Automation ● “Test automation” gives: – Confidence to change – Reducing double checks!! ● Difficulties?: – Old network devices? → No problem – No time to change → No problem – Intermediate states? → No problem – Affects network connectivity? → No problem ✔ ✔ ✔ ✔
  • 5. 5 How to Test? ● You can test your network with tools – Language: Ruby – Test framework: RSpec – Target servers: No Ruby needed Testing server Target server 1 Target server 2 Ruby & RSpec tooltooltooltool SSH/HTTP(S)/DNS Target network
  • 6. 6 Test Tools Type Test target Remarks Serverspec Servers(static) Infrataster Servers(dynamic) Infrataster-plugin-dns (Rspec-dns) DNS servers Infrataster-plugin-firewall Firewalls Traget server needs: tcpdump, netcat Lbspec Load Balancers(L4-L7) Target server needs: ngrep, netcat Rspec-ssltls SSL/TLS
  • 7. 7 Serverspec describe host('target.example.jp') do # ping it { should be_reachable } # tcp port 22 it { should be_reachable.with( port: 22 ) } # set protocol explicitly it { should be_reachable.with( port: 22, proto: 'tcp' ) } end
  • 8. 8 Infrataster-plugin-dns describe server(:dns) do describe dns('www.example.com') do it do is_expected.to have_entry.with_type('A') .and_address('192.0.2.4') end end describe dns('192.0.2.4') do it do is_expected.to have_entry.with_type('PTR') .and_domainname('www.example.com') end end end
  • 9. 9 Infrataster-plugin-firewall describe server(:src) do describe firewall(server(:dst)) do it { is_expected.to be_reachable } it { is_expected.to be_reachable.dest_port(80) } it { is_expected.to be_reachable.tcp.dest_port(80) } it { is_expected.to be_reachable.udp.dest_port(53) } end end
  • 10. 10 Lbspec describe 'vhost_c:80' do it { should transfer(['node_b', 'node_c']])).port(80) } it { should respond('404') } end describe 'loadbalancer' do it do should healthcheck('node_c') .include('/test/healthcheck').from('192.168.1.10') end end
  • 11. 11 Rspec-ssltls describe 'www.example.com:443' do it do is_expected.to have_certificate .subject(CN: '*.example.com').valid_at('2020/09/12 19:00:05 JST') end it { is_expected.to support_protocol('TLSv1_2') } it { is_expected.to support_cipher('AES256-SHA').protocol('TLSv1') } it { is_expected.to support_cipher('DES-CBC3-SHA').protocol('SSLv3') } it do is_expected.to choose_cipher('DES-CBC3-SHA') .protocol('TLSv1') .from(['AES256-SHA', 'AES128-SHA', 'DES-CBC3-SHA']) end end
  • 12. 12 You can get test results $ bundle exec rspec server 'src' via firewall should reach to server 'dst' should reach to server 'dst' dest_port: 80 should reach to server 'dst' tcp dest_port: 80 should reach to server 'dst' udp dest_port: 53 Finished in 15.87 seconds (files took 0.58711 seconds to load) 4 examples, 0 failures $