Name: netdev
Owner: Juniper Networks
Description: Development repository for Opscode Cookbook netdev
Forked from: chef-partners/netdev
Created: 2015-07-10 05:51:09.0
Updated: 2016-01-13 14:26:49.0
Pushed: 2016-04-14 04:33:46.0
Homepage: null
Size: 175
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Provides a set of vendor-agnostic resources for managing networking devices.
Add a dependency on netdev to your cookbook's metadata.rb
nds 'netdev'
All resources are fully documented on Chef's offical documentation site.
Resource | Description | Example Usage | ——-|————-|———| netdev_interface | This resource provides an abstraction for managing physical interfaces on network elements. | netdev_interface integation test fixture netdev_l2_interface | This resource provides an abstraction for creating and deleting layer 2 interfaces on network devices. | netdev_l2_interface integation test fixture. netdev_lag | This resource provides an abstraction for creating and deleting link aggregation group interfaces. | netdev_lag integation test fixture. netdev_vlan | This resource provides an abstraction for creating and deleting VLANs. | netdev_vlan integation test fixture. netdev_group | This resource provides an abstraction for creating and deleting JUNOS Groups. | netdev_group integation test fixture.
You can run the tests in this cookbook using Rake:
integration # Run Test Kitchen integration tests
style # Run all style checks
style:chef # Lint Chef cookbooks
style:ruby # Run Ruby style checks
travis:ci # Run tests on Travis
Test Kitchen 1.0.0+ ships with a proxy driver that proxies commands through to a test instance whose lifecycle is not managed by Test Kitchen. This driver is useful for testing against long-lived non-ephemeral test instances that are simply “reset” between test runs. This driver is also perfect for testing against physical network equipment!
You will need to specify the location and login details for the switch you will be running Test Kitchen against. This should be done in a .kitchen.local.yml
file:
forms:
me: junos-13.2
iver:
# Set the login user of the test switch
username: schisamo
# Set the ipaddress or DNS name of the test switch.
host: 10.66.44.10
# Set the port sshd is listening on; defaults to 22.
port: 22
This repository ships with an example file which can easily be copied into place:
itchen.local.example.yml kitchen.local.yml
Requirements:
JUNOS 13.2*
(other Junos versions
may work).Test run resets on Juniper device is achieved using Juno's rescue configuration feature. A rescue configuration allows you to define a known working configuration or a configuration with a known state that you can roll back to at any time.
Creating a rescue configuration is easy. SSH into your switch and run the following command:
ter:0}
samo@junos-chef-dev> request system configuration rescue save
ter:0}
samo@junos-chef-dev>
You now have a known good state to roll back to! Test Kitchen activates the rescue
configuration by issuing the command cli -c 'configure; rollback rescue; commit'
during the CREATE and DESTROY stages of testing. Reference the .kitchen.yml
for some additional environment variables that are used to set host
, username
and
sshd port
of the switch being tested against.
Currently not supported.
nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.