From be443338aa2cb48034e6aa28c19efe954e0f3d32 Mon Sep 17 00:00:00 2001 From: saichint Date: Wed, 31 May 2017 10:06:34 -0700 Subject: [PATCH] Release 1.7.0 (#458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added IOS XR support for tacacs_server * Updated CHANGELOG * Update CHANGELOG.md * Added support on IOS XR for tacacs_server_group * remove sync damage from demo_bridge * Refactored network_interface provider. Updated tests and code to support IOS XR. * Matrix updates for overlay_global & network_trunk * domain and search options are mutually exclusive http://man7.org/linux/man-pages/man5/resolv.conf.5.html * Remove source_interface_hold_down_time for 8k * Collapse release_1.3.2 to develop * cisco_bfd_global: new properties (#334) * manifest * type file add * provider file * array types * beaker * add loopback int * remove name * fix manifest * documentation * comment * Review comments * Fix README * Fix README * network_snmp ios_xr does not support global enable * bgp_neighbor: add bfd (#340) * manifest * type file add * provider file * array types * beaker * add loopback int * remove name * fix manifest * documentation * comment * Review comments * Fix README * Fix README * add bfd to bgp_neighbor * bfd prop * documentation * Fix BFD caveat * Update CHANGELOG.md * search_domain, tests platform agnostic (#343) * modificatins for snmp_notification on IOS_XR * test fixes for ios_xr snmp_notification_receiver (#338) * Add test_get / test_set to command_config (#348) * Add test_get / test_set to command_config * Needed a way for beaker to query / set config that didn't have explicit resource support (e.g. disabling a feature) * test_get is a simple get-only property that does a show running; callers set a filter to parse what they need: `puppet resource cisco_command_config 'cc' test_get='incl feature'` * test_set is a simple set-only property: `puppet resource cisco_command_config 'cc' test_set='no feature foo'` * Tested on n3,n5,n7,n9 * Bad regex in bkr test service_provider_nondefaults.rb * Add beaker test_get / test_set * config_find_remove() uses test_get to search for existing configs, then test_set to remove it. * Fix the fabricpath tests which ran into an issue on n5k when cleaning up 'feature nv overlay' with command_config: Puppet resource removes the config but then immediately does a 'show runn' which gets a SAP timeout on the device itself and the test errors. Using the test_set setter instead of regular command_config gets around this problem because it's a "set-only" with a dummy test_set getter. * Tested on n5,n7,n9 * test_get: add debugs, comments * tested on n5 * Skipped tacacs provider test on IOS XR (#350) * Refactor tests: aaa_group_tacacs (#351) * Converted to new test syntax * Tested on n9-i4 * Add cisco_ospf_area provider (#352) This PR is for cisco_ospf_area provider. The properties do not include nssa and its associated properties. They will be added as part of another user story. Since this provider becomes absent when all properties are set to default, cisco_pim model is followed for beaker tests. All demo_manifests and beaker tests passed on all platforms. Squashed commits: * first commit * fix issues * remove comment * Fix stub * fix area to ipaddr or int * small error * beaker tests * documentation * review comments * Update README.md * Review comments about stub * Added IOS XR support for snmp_user (#353) * Add nssa properties to ospf_area provider (#354) * first commit * fix issues * remove comment * Fix stub * fix area to ipaddr or int * small error * beaker tests * documentation * review comments * Update README.md * Review comments about stub * nssa * small correction * name changes * fix manifest * fix nssa_set * include cmnutils * beaker test added for nssa * typo fix * documentation * fix docmentation * fix README * Fix review comments * tacacs_global changes for ios_xr (#342) * router_ospf_area_vlink: new provider (#355) Adds virtual-link support * Fixes for cisco_interface_ospf provider (#357) * Fix interface_ospf provider and beaker * doc * doc * review comments * minor vrf name change * to avoid annoying conflict with 'management' * command_config: undefined method 'previous' (#358) * Symptom: Simple cc manifest with a faulty line of config: cisco_command_config { 'interface': command => ' interface loopback42 ipv6 pim foo ' } When puppet agent runs the cc provider drops into a rescue which should first print out the parts of the config that were successfully processed and then do a raise, but instead we see: ``` Error: undefined method 'previous' for # ``` * Analysis: `client.rb` was refactored a few months ago, wherein the `previous` hash key was renamed to `successful_input`. The cc providers (both puppet & chef) never got updated with the new key name. * Ref: https://github.com/cisco/cisco-network-node-utils/blob/develop/lib/cisco_node_utils/client/nxapi/client.rb#L285 * Testing: ``` Linux# puppet agent -t --debug ... Info: Cisco_command_config[interface](provider=cisco): Successfully updated: interface loopback42 Error: The command 'ipv6 pim foo' was rejected with error: % Invalid command Error: /Stage[main]/Main/Node[default]/Cisco_command_config[interface]/command: change from to interface loopback42 ipv6 pim foo failed: The command 'ipv6 pim foo' was rejected with error: % Invalid command ``` * Merge release_1.3.2 --> develop (#365) * Add note on existing_str * Refactor test_interface.rb into multiple files * This test was trying to do too much; it became too large and unwieldy to use and troubleshoot. * Refactor to use new test syntax (test_harness_run) * File changes: * deleted: test_interface.rb * new file: interfacelib.rb * new file: test_interface_L2.rb * new file: test_interface_L3.rb * new file: test_interface_bdi.rb * modified: test_interface_capabilities.rb * modified: test_interface_stp.rb * new file: test_interface_svi.rb * new file: test_interface_private_vlan.rb * renamed test_vlan_mapping.rb to test_interface_vlan_mapping.rb * Only tested on n7k and n9k so far but there's a lot here and I wanted to get some eyes on the changes * Platform tweaks for test_interface* * test_interface: add skip_unless_supported plat checks * Minor change to bail out of the test immediately if the platform does not apply * test_interface_private_vlan: fix trunk assoc cleanup * Found a bug on n9k where 'private-vlan association trunk' does not get cleaned up by 'default interface', which breaks this beaker test * Created a workaround cleanup method that does 'no switchport' * Tested on N9k-I3 * test_private_vlan: refactor, remove redundancies * Refactored to use new test syntax; removed unnecessary/redundant tests and some that didn't test anything * This test suffers from the same idempotency bug as the interface private-vlan code; it will require the same kind of fix * Tested on n9k-I3, N7 * Bump version number. * Add testing for switchport_autostate_exclude * Remove old and redudant access_vlan tests * Remove old style beaker tests * normalize_range_array for puppet This is the puppet counter-part to NU. The notes below are copied from: https://github.com/cisco/cisco-network-node-utils/pull/400 The main difference between these is a default check in Utils.normalize_range_array and that there's no Utils.dash_range_to_elements since that's not needed in puppet. * The motivation for this change was finding yet another array normalizer in the private vlan code so these changes are initially meant to address fixes there. IMO our range summarize methods were getting a bit long and difficult to maintain; these new methods will hopefully simplify things somewhat. * The main problem these methods are trying to solve is reconciling manifest inputs with getter results when there are overlapping ranges; e.g.: * '2-5, 9, 4-6' needs to be ['2-6', '9'] * ['2', '3', '4-6'] needs to be ['2-6'] * ['2', '3', '4'] needs to be ['2-4'] * It's fairly easy to merge the ranges if they are actual ruby ranges instead of the dash-syntax ranges, so the new methods just convert to ruby ranges, merge, and convert back. * Tested on n9k. Additional testing coming on the other platforms, as well well as demo, Readme, etc. * bgp_af l2vpn * Fix demo_bgp * Fix additional_paths_install * New beaker style vlan tests * l2vpn/evpn support * l2vpn/evpn support * exclude n3k * review comments * Review comments * cisco_interface: deprecate private_vlan* * private_vlan refactor * cisco_interface: private_vlan refactor * Deprecated the private_vlan properties that were released with 1.3.0 and created new pvlan properties in their place. * This is the companion to NU PR: https://github.com/cisco/cisco-network-node-utils/pull/406 * Updated Type, Provider, Beaker, Demo, README, and CHANGELOG. * Currently only tested on N7, N9-i3. Additional testing in prog. * readme and changelog * readme and changelog * Update README.md * pvlan beaker fixups for 6k * The 6k cli is strict about requiring vlan associations before allowing interface vlan association; therefore I added the dependencies to the test. I need to rerun the test on all the platforms to see if the platform check needs to be tweaked. * Only tested on n6 so far * Minor demo_interface changes * Added some private-vlan dependency resources * test_interface_private_vlan: n3k platform fixes * demo manifest as well * tested on n3-i4,n9-i2,n5,n9-i3,n7 * test_interface_stp needs vlan cleanup * tested on n9-i3 * Re-add n8k doc references * Fix some N8k references * Add N8k back to support table * Remove extra property * Fix spacing in rotate property * anycast_gateway platform checks * Restrict the anycast test to n9k only * Tested on n3,n7,n9-i2,n9-i3 * test_interface_service_vni script fixes * Some cleanup / setup was insufficient * :non_default was not getting run * This is only supported on n7k; tested on n7k. * test_vrf: f3 dependencies * N7k needs an f3-only vdc for route_distinguisher * tested on n7 * test_vrf_af: add f3 dependency for 7k * tested on n7k * Update README-agent-install.md * Update README.md * test_vlan/test_private_vlan: add f3 deps * Tested on n7 * test_vxlan_vtep*: add f3 deps * Tested on n7 * Refactor package provider to use rpm - qip (#328) * Replace regexp with rpm -qip * patching demo updates * Updated fail message * Update demo_patching.pp * Add back rpm filename regexp support (#329) * Add back rpm filename regexp support * Remove debugs * Update README.md * interface svi fix * Remove explicit anycast config * anycast-gateway-mac is a required dependency; a recent commit added an explicit call to the test file to set this up; BUT we already had existing code for doing this that was part of interfacelib.rb * The interfacelib code was returning early because of /unless/if/ * Tested on n9-i4 * test_interface_L2 should reset sys_def_switchport * This test sets the system default switchport state to true but it should reset it to false when it's finished. * Tested on n9-i4 * test_vxlan_vtep_vni: suppress_uuc broken * There was a platform exception that tried to add this property using the new test syntax; however this test file uses an older syntax. * Added an nv overlay hw support check (my n6k does not support nv overlay) * Tested on n6 * README-agent-install: doc cleanup (#330) * README-agent-install: doc cleanup * This doc has had a lot of misc updates in the past so I tried to streamline the content somewhat and organize the sections into discrete steps. * A couple of things that need a closer look: * The RPM table may need updating to reflect the GS fix coming out any day * The auto-install section for cisco_node_utils gem is a little weak. I'm not sure if I referenced the correct pp file and used the right directory target. * README-agent-install.md: Cleanup node-utils section * README-agent-install.md: fix broken links * Review comments addressed * All addressed except for the GS RPM comment. * README-agent-install: GS RPM v1.5 tested * Add markdown syntax flags * README.md cleanup for 1.3.2 (#335) * Move Document Workflow Map to Documentation Guide table * README: Move Limitations into Platform Support * Add Legend & tables * README: Update Usage section * README: Move platform support section after resource ref tables * README.md: minor text change * URL change: /develop/master/ * Addressed remaining PR comments * /develop/master/ URL fixup * test_vdc: fix for non-F3 testbeds (#336) * test_vdc: fix for non-F3 testbeds * Updated this test to work with non-F3 N7k testbeds. * Initially set the VDC module-type to default state * Then set module-type to F3 and test * There's no great way to know which way to leave the module-type when this test completes, so: * Reset module-type to default for non-F3 testbeds since leaving it as F3 means the device won't have any usable interfaces * Noop for F3 testbeds so that it leaves their F3 still usable * Tested on n6, n7-non-F3 * beaker tests: add F3 dependencies * vdc, bridge-domain tests * tested on n6, n7-non-F3 * Fix vxlan_vtep_vni suppress_uuc prop (#341) * Readme.md changes for itd_service (#346) * itd_service pre requisite * cleanup * cleanup * review comment * review comment * review comment * Add n8k reference to CHANGELOG * command_config: undefined method 'previous' (#358) * Symptom: Simple cc manifest with a faulty line of config: cisco_command_config { 'interface': command => ' interface loopback42 ipv6 pim foo ' } When puppet agent runs the cc provider drops into a rescue which should first print out the parts of the config that were successfully processed and then do a raise, but instead we see: ``` Error: undefined method 'previous' for # ``` * Analysis: `client.rb` was refactored a few months ago, wherein the `previous` hash key was renamed to `successful_input`. The cc providers (both puppet & chef) never got updated with the new key name. * Ref: https://github.com/cisco/cisco-network-node-utils/blob/develop/lib/cisco_node_utils/client/nxapi/client.rb#L285 * Testing: ``` Linux# puppet agent -t --debug ... Info: Cisco_command_config[interface](provider=cisco): Successfully updated: interface loopback42 Error: The command 'ipv6 pim foo' was rejected with error: % Invalid command Error: /Stage[main]/Main/Node[default]/Cisco_command_config[interface]/command: change from to interface loopback42 ipv6 pim foo failed: The command 'ipv6 pim foo' was rejected with error: % Invalid command ``` * New overlay_global behaviors (#360) * DME changes for l2rib properties resulted in removal of the 'default' keyword from the cli: `l2rib dup-host-mac-detection default` * Prior to this change, 'default' was the only way to reset the host_moves & timeout properties back to default; there was/is no 'no' command, so the only way to reset it now is to re-enter the command with the default values. * This change necessitates changes to the setter, minitest, and beaker. I also changed the default values to actual integer values instead of empty strings. * Tested minitest & beaker for: n9-edev,n9-I4,n5,n6. Skips for n3 (normal) and n7 (requires F3 card). * Remove vsh code (#361) * Fix cisco_aaa* 'TACACS+ group delete denied, group is in use' issue (#362) * Added setup and cleanup steps * Add back needed autorequires * Added cleanup and teardown calls * Refactor setup/cleanup * Remove debug causing beaker tests to error out * Fix cisco_tacacs* 'TACACS+ group delete denied, group is in use' (#363) * Added setup and cleanup steps * Add back needed autorequires * Added cleanup and teardown calls * Refactor setup/cleanup * Remove debug causing beaker tests to error out * Add setup/cleanup steps * Fix netdev tacacs* 'TACACS+ group delete denied, group is in use' (#364) * Added setup and cleanup steps * Add back needed autorequires * Added cleanup and teardown calls * Refactor setup/cleanup * Remove debug causing beaker tests to error out * Add setup/cleanup steps * Add setup/cleanup steps * Fixed merge issue * Add noop beaker test * This is a dummy test for use during CI development * Move noop.rb to base dir * Munge events value 'false' to 'size_disable' (#366) Due to recent platform changes, the CLI for `event_history events size disable` now results in the config `no event-history events`. This change munges the manifest value of `false` to `size_disable`. * Ospf bfd for interfaces (#367) * Fix interface_ospf provider and beaker * doc * doc * review comments * bfd added to router ospf vrf * bfd_per_link added to interface_portchannel * add bfd and network to int ospf * add bfd echo to intf * changelog * doc * Remove get_vshell_cmd calls (#368) * L3 PIM-on-VRF-intf beaker fix (#369) * ip pim sparse-mode was failing to nvgen during the test * Factors: a) the intf is in vrf 'test1'; and, b) 'test1' has not been instantiated yet * Normally these forward-references are not a problem but the new DME-based PIM cli is silently rejecting it because the vrf is not instantiated * For puppet it's not unreasonable to require a pre-instantiated vrf, and since this change only affects our beaker test I'm just going to update the test. The PIM team did say they would reconsider raising an error for this, or better yet just create the pim cli object regardless of vrf-instantiation state. * Also fixed a cleanup issue for dot1q sub-ints. * Tested on N9-I5 * Add Ospf properties for interfaces (#371) * Fix interface_ospf provider and beaker * doc * doc * review comments * add mtu, pri, shut and tx delay to int ospf * documentation * Fix beaker test bug (#372) * bug fix for interface_portchannel beaker test (#373) * Fix interface_ospf provider and beaker * doc * doc * review comments * add mtu, pri, shut and tx delay to int ospf * documentation * bug fix * Removed, no longer needed * Remove broken snmp_user XR support (#374) * Add agent_probe to utility.lib (#375) * `feature vn-segment-vlan-based` is not supported on some n3k's * Added a simple helper method to test for h/w support; the result is then used by `unsupported_properties` to update the test cases * Tested on n3k(3048), n7k, n9k * Add f3 utility for n7 bkr tests (#376) * Tested on n7k * Fix half/full in test_duplex (#377) * For some 3k, need to munge 'half/full' into csv-style 'half,full' to play nice with interface_capabilities * This fix is a little trickier than the NU fix because the output from puppet resource is 'raw' whereas the NU output is a pre-processed hash of capabilities; thus we have to be careful not to munge the vsh or puppet resource output. * Tested on n3048 * Update service provider beaker test to work in guestshell (#378) * Select service based on OS family * Update fail_test message * Add teardowns to beaker (#379) * f3 handling for test_vrf (#380) * f3 handling for test_vrf * N7k setup/cleanup when missing F3 cards * New `image?` method for checking image version pattern; used as test for unprops * New `remove_all_vrfs` method that uses `test_get`/`test_set`; this is much faster than removing vrfs one at a time * Remove :description image check * Remove redundant cleanup * f3 setup/teardown for vrf_af * f3 setup/teardown bridge-domain * f3 setup/teardown for encap * bkr setup/teardown cleanups * f3 setup/teardown for interface_svi * f3 setup/teardown for service_vni * f3 setup/teardown test_private_vlan * f3 setup/teardown for vxlan_vtep* * f3 setup/teardown for fabricpath_topology * setup/teardown cleanups for cisco_itd_device_group_node * beaker fix for resilient and symmetry non support on n3k (#381) * Fix interface_ospf provider and beaker * doc * doc * review comments * add mtu, pri, shut and tx delay to int ospf * documentation * bug fix * Fix for symmetry and resilient no support on n3k * review comment * rewview comments * setup/teardown for bfd_global * setup/teardown bridge_domain * setup/teardown acl * setup/teardown bgp_af * setup/teardown cisco_pim * Convert test_fabricpath_global to new syntax * Setup/teardown test_interface_L3 * setup/teardown test_interface_private_vlan * Convert test_interface_channel_group to new syntax * Convert test_interface_portchannel to new syntax * setup/teardown for test_itd_service * setup/teardown cisco_ospf_area* * setup/teardown cisco_interface_ospf * setup/teardown cisco_ospf_vrf * Bad cleanup test_itd_service * Convert test_command_config to new syntax * better cleanup for bfd * setup/teardown for test_bgp * setup/teardown test_bgpaf * better cleanup for pim * setup/teardown test_bgpneighbor * Better remove_all_vlans * setup/teardown test_bgpneighboraf * ospf_vrf cleanup should remove feature bfd * setup/teardown test_stp_global * setup/teardown test_bgpneighbor* * better cleanup test_interface_L3 * better cleanup test_interface_ospf * setup/teardown test_interface_portchannel * setup/teardown test_interface_stp * setup/teardown test_interface_bdi * setup/teardown test_evpn_vni * Convert test_vpc_domain to new syntax * setup/teardown test_itd_device_group * Convert test_overlay_global to new syntax * Rel140/refactor package tests (#382) * Refactor beaker package tests * Remove unused code * Rubocop fix * Uncomment filename * Add ensure_prop_override setting * Rubocop fix * Fix test_itd_service * The cleanup in the dependency manifest was turning off 'feature itd' but that needs to be re-enabled in order to configure the itd device-group dependency * beaker: Remove raise_skip call from summary checker * test_interface_ospf dependency fix * Add :array opt to test_get bkr utility * Enable yum package testing in guestshell (#384) * Initial gs package test support * Minor refactoring * Add camden i2.1 patch details * Use specific yum patch for camden fcs * Separate native and gs test flow * Remove ensure absent in manifest_props * Enable additional releases * I5 patch fix * Use single workflow for gs and native * Convert test_snmp_server to new syntax (#385) * Convert test_snmp_server to new syntax * packetsize was failing on n7k so I just rewrote the test to use the new format * tested on n7k,n9k-I5 * Fix pktsize cleanup * Rename test_package.rb -> test_package_patch.rb * Converted the old style tests to new syntax. (#386) Most of these are straightforward changes. The package test is complicated on native since third-party rpms require setting up a yum repo, but I set up the test to do the repo init via puppet so we actually get a bit more coverage this way. * Tested on N5,N7,N9-I5 using native/GS/OAC * utilitylib: Restore tests[id][:resource]['ensure'] I pulled this out by mistake with this commit: https://github.com/cisco/cisco-network-puppet-module/commit/2641c7a1c821b9b512510ad3a2952f5dbfe7c0fd#diff-e0883d3270eb11e5d50fcdc5c4f83003L603 * test_interface_ospf: Fix process dependency * A previous test cleanup removed 'router ospf Sample' from the harness dependencies; now the nightly if failing when it tries to configure an ospf config on an interface * Although the router config is not necessary for the interface config, the failure occurs because the ospf process is still starting up (ospf startup is slow on 5k/6k/8k). The ospf provider already has a 'wait_for_process_initialized' method to handle this slow start, while the interface_ospf provider does not. This is only an issue during testing so I do not propose adding the wait_for method to interface_ospf. * Tested on n5,n7,n9 * test_interface_ospf: Fix process dependency (#388) * A previous test cleanup removed 'router ospf Sample' from the harness dependencies; now the nightly if failing when it tries to configure an ospf config on an interface * Although the router config is not necessary for the interface config, the failure occurs because the ospf process is still starting up (ospf startup is slow on 5k/6k/8k). The ospf provider already has a 'wait_for_process_initialized' method to handle this slow start, while the interface_ospf provider does not. This is only an issue during testing so I do not propose adding the wait_for method to interface_ospf. * Tested on n5,n7,n9 * Add log.error to beaker search_pattern * When test_resource fails it just displays what it's expecting to find but it doesn't show what the current output was (which often helps with troubleshooting). This just includes the output when there's a failure. * Add titles for bgp vrf beaker tests * Suppress fib pending fix (#387) * Generalize the method for checking nexus images * Fix suppress fib pending for non-I5 images * Clean up image check and post-merge leftovers * cisco_interface enhancement (#389) * Fix interface_ospf provider and beaker * doc * doc * review comments * add mtu, pri, shut and tx delay to int ospf * documentation * bug fix * Fix for symmetry and resilient no support on n3k * review comment * rewview comments * dhcp relay and storm control -- not tested yet * beaker test * fix non default test * removed storm control broadcast and multicast for n7k * fix munging * demo manifest changes * cleanup manifests * dhcp and l3 are merged * merge L2 and storm control * docs * review comments * Add'l cleanup for test_interface_ospf * Fix id bug * Replace skip_nexus_i2_image() with skip_nexus_image() api call (#390) * Skip dns provider test instead of error * Remove commented out call to fail api * Update test_harness_dependencies for test_interface_ospf.rb (#393) * Fixed rubocop errors * Remove debug code * Dhcp Relay Global (#392) * Fix interface_ospf provider and beaker * doc * doc * review comments * add mtu, pri, shut and tx delay to int ospf * documentation * bug fix * Fix for symmetry and resilient no support on n3k * review comment * rewview comments * dhcp relay and storm control -- not tested yet * beaker test * fix non default test * removed storm control broadcast and multicast for n7k * fix munging * demo manifest changes * cleanup manifests * dhcp and l3 are merged * merge L2 and storm control * docs * review comments * dhcp_relay_global provider * beaker * fix beaker * Fix provider code for removal of name * documentation * typo in beaker * fix doc * fix doc * fix doc for version * Remove packet_size prop testing for I2 and I3 images * cisco_interface beaker test (#394) * Fix interface_ospf provider and beaker * doc * doc * review comments * add mtu, pri, shut and tx delay to int ospf * documentation * bug fix * Fix for symmetry and resilient no support on n3k * review comment * rewview comments * dhcp relay and storm control -- not tested yet * beaker test * fix non default test * removed storm control broadcast and multicast for n7k * fix munging * demo manifest changes * cleanup manifests * dhcp and l3 are merged * merge L2 and storm control * docs * review comments * dhcp_relay_global provider * beaker * fix beaker * Fix provider code for removal of name * documentation * typo in beaker * fix doc * fix doc * fix doc for version * fix beaker test for intf * event_history_periodic changes for bgp (#395) * Fix interface_ospf provider and beaker * doc * doc * review comments * add mtu, pri, shut and tx delay to int ospf * documentation * bug fix * Fix for symmetry and resilient no support on n3k * review comment * rewview comments * dhcp relay and storm control -- not tested yet * beaker test * fix non default test * removed storm control broadcast and multicast for n7k * fix munging * demo manifest changes * cleanup manifests * dhcp and l3 are merged * merge L2 and storm control * docs * review comments * dhcp_relay_global provider * beaker * fix beaker * Fix provider code for removal of name * documentation * typo in beaker * fix doc * fix doc * fix doc for version * fix beaker test for intf * fix bgp for event_history * move facter to provider * beaker for event_history_periodic * documentation * review comments * review comments * bgp event_history (#400) * fix bgp event-history * beaker changes * doc and manifest * review comments * manifest review comment * Rel141/lacp suspend (#401) * Fix lacp_suspend_individual property issue in evergreen * Remove unneeded test_set call in test_interface_portchannel.rb * Update README.me with lacp_suspend_individual caveat * Futher clarify caveat for lacp_suspend_individual property * Futher clarify caveat for lacp_suspend_individual property * Test non-default value for n3k * fix vrf beaker (#402) * Remove comment that no longer applied with the latest node utils gem * Scrub N8k References * hsrp_global and interface hsrp (#404) * hsrp global new provider * hsrp interface * beaker of intf_hsrp * move int_hsrp to int * documentation * Rel150/n8k n9kf rebranding (#406) * N8k -> N9K-F changes * Fix puppet module function name * Remove old README doc * Update N9k-F Module Version * Additional N8k -> N9K-F updates * Refactor platform_fretta function to use os_release fact * Update platform_fretta function comments * Fix image version check * Skip privte vlan tests on n9k-f * Skip cisco_itd tests on n9k-f * Skip private vlan tests on n9k-f * Skip cisco_vpc tests on n9k-f * Anchor n9k platform check * Update platform regexp to use correct packet size for fretta * Rel150/product tag (#407) * Add product_tag helper method * Fix bug in product_tag api * Update CHANGELOG.md * Interface HSRP group (#405) * hsrp global new provider * hsrp interface * beaker of intf_hsrp * move int_hsrp to int * documentation * hsrp group fixes * fix array issue * add validations * demo manifest * beaker * documentation * n8k to n9k-f * review comments * fix event_history for fretta * fixes for review comments * readme change * more comments * Rel150/atherton fretta fixes (#409) * Handle atherton nxapi double quotes * Handle atherton nxapi double quotes * Handle atherton nxapi double quotes for tacacs * Make regexp in nexus_image method more flexible * pim and interface bfd (#410) * pim bfd * doc * Update CHANGELOG.md * n7k atherton hsrp (#411) * pim bfd * doc * fix n7k atherton hsrp * review comments for doc * review comments for doc * Add ('--') separator for /bin/nsenter example. Resolves https://github.com/cisco/cisco-network-puppet-module/issues/413 * Update Copyright date * fix the case sensitive issue for int_hsrp_group (#416) * cisco route map (#418) * pim bfd * doc * fix n7k atherton hsrp * review comments for doc * review comments for doc * partial new code * rest of the code * manifest * fix get issue * fix few errors in manifest * fix manifest * fix few issues * fix next-hop sets * fix manifest * fix few issues * fix vlan string munge * beaker tests * fix manifest * fix beaker * fix case sensitivity for int_hsrp_group name * remove downcase from provider * fixes for fretta * doc * remove 2 props from I4 code * review comments * review comments * fix doc * review comments * add validate for multicast props * route-map provider (#421) * pim bfd * doc * fix n7k atherton hsrp * review comments for doc * review comments for doc * partial new code * rest of the code * manifest * fix get issue * fix few errors in manifest * fix manifest * fix few issues * fix next-hop sets * fix manifest * fix few issues * fix vlan string munge * beaker tests * fix manifest * fix beaker * fix case sensitivity for int_hsrp_group name * remove downcase from provider * fixes for fretta * doc * remove 2 props from I4 code * review comments * review comments * fix doc * review comments * add validate for multicast props * add validate for multicast props * Fix Chrun: console and vty config #417 (#422) * Strip \r characters * Add testcases to validate config with ctrl chars * Remove puts and add inspect to debugs * Add cleanup before next test * Refactor ctrl character pattern and test * Remove puts statements * Add load-interval props to cisco_interface (#425) * add load-interval attribs to interface * clean up changelog * review comment * fix double quotes issue for passwords (#426) * add load-interval attribs to interface * clean up changelog * review comment * double quote string cleanup * review comments * fix backspace issue for dhcp (#428) * Feature/upgrade services (#427) * Add new type for cisco_service * Add new provider cisco_Service * Fix rubopcop errors * fix rubocop errors * Fix date on CopyRight * Rename cisco_service to cisco_upgrade * Redesigned upgrade resource type based on @mikewiebe PR comments * Redesigned upgrade resource provider based on @mikewiebe PR comments * removing cisco_service resource type * rename media to uri and misc. fixes * converting del_boot_image and force_upgrade to bools * Remove whitespace * Source_uri is required * Handle node_utils API change from service to upgrade * Feature/upgrade services (#429) * Add new type for cisco_service * Add new provider cisco_Service * Fix rubopcop errors * fix rubocop errors * Fix date on CopyRight * Rename cisco_service to cisco_upgrade * Redesigned upgrade resource type based on @mikewiebe PR comments * Redesigned upgrade resource provider based on @mikewiebe PR comments * removing cisco_service resource type * rename media to uri and misc. fixes * converting del_boot_image and force_upgrade to bools * Remove whitespace * Source_uri is required * Handle node_utils API change from service to upgrade * Move source_uri validation to provider * remove all route maps after beaker test (#431) * remove all route maps after beaker test * review comment * Feature/upgrade services (#430) * Add new type for cisco_service * Add new provider cisco_Service * Fix rubopcop errors * fix rubocop errors * Fix date on CopyRight * Rename cisco_service to cisco_upgrade * Redesigned upgrade resource type based on @mikewiebe PR comments * Redesigned upgrade resource provider based on @mikewiebe PR comments * removing cisco_service resource type * rename media to uri and misc. fixes * converting del_boot_image and force_upgrade to bools * Remove whitespace * Source_uri is required * Handle node_utils API change from service to upgrade * Move source_uri validation to provider * Added image_version proc and ability to process '()' * Fix rubocop errors * Add new test file for cisco_upgrade resource beaker_tests/cisco_upgrade/test_upgrade_idempotence.rb * Running cisco_upgrade tests on n3k,n9k only * Update README with references to the new cisco_upgrade resource * Update README.md * Add demo manifest for cisco_upgrade * Add new manifest for cisco_upgrade * Added 'cisco_upgrade' to changelog * Update Support Table for cisco_upgrade Add Release for Fretta and update N9K/N3k release to camden 2e * Minor changes to README.md * Update README.md * Minor changes to documentation * Feature/upgrade services (#433) * Add new type for cisco_service * Add new provider cisco_Service * Fix rubopcop errors * fix rubocop errors * Fix date on CopyRight * Rename cisco_service to cisco_upgrade * Redesigned upgrade resource type based on @mikewiebe PR comments * Redesigned upgrade resource provider based on @mikewiebe PR comments * removing cisco_service resource type * rename media to uri and misc. fixes * converting del_boot_image and force_upgrade to bools * Remove whitespace * Source_uri is required * Handle node_utils API change from service to upgrade * Move source_uri validation to provider * Added image_version proc and ability to process '()' * Fix rubocop errors * Add new test file for cisco_upgrade resource beaker_tests/cisco_upgrade/test_upgrade_idempotence.rb * Running cisco_upgrade tests on n3k,n9k only * Update README with references to the new cisco_upgrade resource * Update README.md * Add demo manifest for cisco_upgrade * Add new manifest for cisco_upgrade * Added 'cisco_upgrade' to changelog * Update Support Table for cisco_upgrade Add Release for Fretta and update N9K/N3k release to camden 2e * Minor changes to README.md * Update README.md * Minor changes to documentation * Replace output with stdout.chomp for facter call * Replace heavy_minus_sign emoji with utf-8 ➖symbol in README (#438) Previously the README was a mix of utf-8 symbols and GitHub emoji. This was not properly rendering on Puppet Forge, as GitHub emoji codes are not supported. * use resource name for all cisco provider cases (#439) * fix beaker patch test for evergreen (#440) * fix eth default * Patch skips (#442) * fix beaker patch test for evergreen * skip patching tests for I2 & I3 * add docs * add example * beaker test for purge_config * review comments * Channel group mode addition (#449) * fix channel_group_mode * ad beaker for channel_group_mode * add example manifest * add example manifest * doc * fix readme * fix skip for patch * added dplus5 * add beaker test for no mode * fix netdev port_channel * Remove range checks * Update README.md * Update README-agent-install.md * Feature/upgrade services (#451) * Add new type for cisco_service * Add new provider cisco_Service * Fix rubopcop errors * fix rubocop errors * Fix date on CopyRight * Rename cisco_service to cisco_upgrade * Redesigned upgrade resource type based on @mikewiebe PR comments * Redesigned upgrade resource provider based on @mikewiebe PR comments * removing cisco_service resource type * rename media to uri and misc. fixes * converting del_boot_image and force_upgrade to bools * Remove whitespace * Source_uri is required * Handle node_utils API change from service to upgrade * Move source_uri validation to provider * Added image_version proc and ability to process '()' * Fix rubocop errors * Add new test file for cisco_upgrade resource beaker_tests/cisco_upgrade/test_upgrade_idempotence.rb * Running cisco_upgrade tests on n3k,n9k only * Update README with references to the new cisco_upgrade resource * Update README.md * Add demo manifest for cisco_upgrade * Add new manifest for cisco_upgrade * Added 'cisco_upgrade' to changelog * Update Support Table for cisco_upgrade Add Release for Fretta and update N9K/N3k release to camden 2e * Minor changes to README.md * Update README.md * Minor changes to documentation * Replace output with stdout.chomp for facter call * deprecate 'version' and add new property 'package' * Add support for tftp: URI Also added new property package and warning to handle deprecation of ‘version’ * Update tests * Fix typo * Modify failure message * Rework validation * remove package nil check * Add package to UPGRADE_NON_BOOL_PROPS * Fix beaker test * Add source uri validation for usb * Fix rubocop errors * Remove references to 'version' * Update Documentation * Removing source_uri and repurposing package * Adding full package path to type * Move Uri Processing to the provider * Add 'version' back for tests * Updating documentation to remove source_uri * Fix rubocop errors * Incorporating feedback on documentation * (NETDEV-29) Enhance ntp_config and ntp_server add ntp_auth_key (#447) This commit enhances the existing ntp_config and ntp_server providers and adds ntp_auth_key ntp_config - authenticate - trusted_key ntp_server - key - maxpoll - minpoll - source_interface - vrf ntp_auth_key - key - algorithim - mode - password * Exclude (#453) * adding excluded props for versions * add bgp_neighbor exclude * more tests for adding properties * vxlan_vtep to be tested * vxlan_vtp_vni beaker * fix beaker dependency manifest * doc * README.md * typo fix * examples * rubocop fix * Update release checklist (#455) * Update release checklist * Fix CHANGELOG link. * Fixed typo. * Bgp address family aggregate address (#454) * provider code for bgp af aggregate addr * comment cleanup * doc * review comments * add require ipaddr and cmnutils (#456) * version change * ntp props added to README * skip addl-paths selection for n9k I5.3 * missing patch file tests added * Fretta and Freeport added * Update release date --- CHANGELOG.md | 55 +++ README.md | 282 ++++++++++--- docs/README-agent-install.md | 2 +- docs/README-maintainers.md | 153 +++---- examples/cisco/demo_bgp.pp | 13 + examples/cisco/demo_interface.pp | 33 +- examples/cisco/demo_upgrade.pp | 10 +- lib/facter/cisco.rb | 2 + lib/puppet/feature/cisco_node_utils.rb | 2 +- lib/puppet/provider/cisco_bgp_af_aa/cisco.rb | 185 ++++++++ lib/puppet/provider/cisco_interface/cisco.rb | 1 + .../cisco_interface_channel_group/cisco.rb | 11 + lib/puppet/provider/cisco_upgrade/cisco.rb | 30 +- lib/puppet/provider/ntp_auth_key/cisco.rb | 113 +++++ lib/puppet/provider/ntp_config/cisco.rb | 93 +++- lib/puppet/provider/ntp_server/cisco.rb | 42 +- lib/puppet/provider/package/cisco.rb | 4 +- lib/puppet/provider/port_channel/cisco.rb | 2 +- lib/puppet/type/cisco_bgp_af_aa.rb | 162 +++++++ lib/puppet/type/cisco_interface.rb | 13 + .../type/cisco_interface_channel_group.rb | 20 +- lib/puppet/type/cisco_upgrade.rb | 49 +-- lib/puppet/type/cisco_vpc_domain.rb | 103 +---- metadata.json | 9 +- .../cisco_bfd_global/test_bfd_global.rb | 9 +- tests/beaker_tests/cisco_bgp/test_bgp.rb | 18 +- tests/beaker_tests/cisco_bgp_af/test_bgpaf.rb | 2 + .../cisco_bgp_af_aa/test_bgp_af_aa.rb | 114 +++++ .../cisco_bgp_neighbor/test_bgpneighbor.rb | 8 +- .../test_dhcp_relay_global.rb | 9 +- .../cisco_interface/test_interface_L2.rb | 12 + .../test_interface_channel_group.rb | 36 +- .../test_overlay_global.rb | 22 +- .../cisco_route_map/test_route_map.rb | 41 +- .../cisco_stp_global/test_stp_global.rb | 68 +-- .../cisco_upgrade/test_upgrade_idempotence.rb | 7 +- .../cisco_vpc_domain/test_vpc_domain.rb | 39 +- .../cisco_vxlan_vtep/test_vxlan_vtep.rb | 8 +- .../test_vxlan_vtep_vni.rb | 399 +++++++----------- .../test_package_patch.rb | 24 +- tests/beaker_tests/lib/utilitylib.rb | 44 +- .../ntp_auth_key_provider_defaults.rb | 131 ++++++ .../ntp_auth_key/ntp_auth_keylib.rb | 70 +++ .../beaker_tests/ntp_config/ntp_configlib.rb | 20 +- .../ntp_server_provider_defaults.rb | 31 +- .../ntp_server_provider_nondefaults.rb | 151 +++++++ .../beaker_tests/ntp_server/ntp_serverlib.rb | 41 +- 47 files changed, 1954 insertions(+), 739 deletions(-) create mode 100644 lib/puppet/provider/cisco_bgp_af_aa/cisco.rb create mode 100644 lib/puppet/provider/ntp_auth_key/cisco.rb create mode 100644 lib/puppet/type/cisco_bgp_af_aa.rb create mode 100644 tests/beaker_tests/cisco_bgp_af_aa/test_bgp_af_aa.rb create mode 100644 tests/beaker_tests/ntp_auth_key/ntp_auth_key_provider_defaults.rb create mode 100644 tests/beaker_tests/ntp_auth_key/ntp_auth_keylib.rb create mode 100644 tests/beaker_tests/ntp_server/ntp_server_provider_nondefaults.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d716070b..30d1fab24 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,51 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [1.7.0] - 2017-05-31 + +### New feature support +#### Cisco Resources +- `cisco_bgp_af_aa` type and provider. + +### Added +- Extend cisco_interface with attributes: + - `purge_config` + +- Extend cisco_interface_channel_group with attributes: + - `channel_group_mode` + +- Added support for tftp and usb URIs to `cisco_upgrade` + +- Extend `cisco_upgrade` with attributes: + - `package` + +- Added `ntp_auth_key` with attributes: + - `algorithm` + - `key` + - `mode` + - `password` + +- Extend `ntp_config` with attributes: + - `authenticate` + - `trusted_key` + +- Extend `ntp_server` with attributes: + - `key` + - `maxpoll` + - `minpoll` + - `vrf` + +### Changed + +### Removed +- Deprecated `version` and `source_uri` attributes for `cisco_upgrade` in favor of a single attribute `package`. + +### Resolved Issues +* https://github.com/cisco/cisco-network-puppet-module/issues/424 +* https://github.com/cisco/cisco-network-puppet-module/issues/432 +* https://github.com/cisco/cisco-network-puppet-module/issues/446 +* https://github.com/cisco/cisco-network-puppet-module/issues/452 + ## [1.6.0] - 2017-03-13 ### New feature support @@ -19,6 +64,15 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Removed +### Resolved Issues +* https://github.com/cisco/cisco-network-puppet-module/issues/413 +* https://github.com/cisco/cisco-network-puppet-module/issues/414 +* https://github.com/cisco/cisco-network-puppet-module/issues/415 +* https://github.com/cisco/cisco-network-puppet-module/issues/417 +* https://github.com/cisco/cisco-network-puppet-module/issues/419 +* https://github.com/cisco/cisco-network-puppet-module/issues/420 +* https://github.com/cisco/cisco-network-puppet-module/issues/423 + ## [1.5.0] - 2017-01-11 ### New feature support @@ -354,6 +408,7 @@ This version was never released. - Initial release of puppetlabs-ciscopuppet module, supporting Cisco NX-OS software release 7.0(3)I2(1) on Cisco Nexus switch platforms: N95xx, N93xx, N30xx and N31xx. - Please note: 0.9.0 is an EFT pre-release for a limited audience with access to NX-OS 7.0(3)I2(1). Additional code changes may occur in 0.9.x prior to the final 1.0.0 release. +[1.7.0]: https://github.com/cisco/cisco-network-puppet-module/compare/v1.6.0...v1.7.0 [1.6.0]: https://github.com/cisco/cisco-network-puppet-module/compare/v1.5.0...v1.6.0 [1.5.0]: https://github.com/cisco/cisco-network-puppet-module/compare/v1.4.1...v1.5.0 [1.4.1]: https://github.com/cisco/cisco-network-puppet-module/compare/v1.4.0...v1.4.1 diff --git a/README.md b/README.md index fbcd83341..d852616ad 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,7 @@ The following resources include cisco types and providers along with cisco provi * [`cisco_vrf_af`](#type-cisco_vrf_af) * [`cisco_bgp`](#type-cisco_bgp) * [`cisco_bgp_af`](#type-cisco_bgp_af) + * [`cisco_bgp_af_aa`](#type-cisco_bgp_af_aa) * [`cisco_bgp_neighbor`](#type-cisco_bgp_neighbor) * [`cisco_bgp_neighbor_af`](#type-cisco_bgp_neighbor_af) @@ -210,6 +211,7 @@ The following resources include cisco types and providers along with cisco provi * [`cisco_pim_rp_address`](#type-cisco_pim_rp_address) * NTP Types + * [`ntp_auth_key (netdev_stdlib)`](#type-ntp_auth_key) * [`ntp_config (netdev_stdlib)`](#type-ntp_config) * [`ntp_server (netdev_stdlib)`](#type-ntp_server) @@ -299,6 +301,7 @@ The following resources include cisco types and providers along with cisco provi * [`cisco_bfd_global`](#type-cisco_bfd_global) * [`cisco_bgp`](#type-cisco_bgp) * [`cisco_bgp_af`](#type-cisco_bgp_af) +* [`cisco_bgp_af_aa`](#type-cisco_bgp_af_aa) * [`cisco_bgp_neighbor`](#type-cisco_bgp_neighbor) * [`cisco_bgp_neighbor_af`](#type-cisco_bgp_neighbor_af) * [`cisco_bridge_domain`](#type-cisco_bridge_domain) @@ -355,6 +358,7 @@ The following resources include cisco types and providers along with cisco provi * [`network_snmp`](#type-network_snmp) * [`network_trunk`](#type-network_trunk) * [`network_vlan`](#type-network_vlan) +* [`ntp_auth_key`](#type-ntp_auth_key) * [`ntp_config`](#type-ntp_config) * [`ntp_server`](#type-ntp_server) * [`port_channel`](#type-port_channel) @@ -396,11 +400,11 @@ Platform | Description | Environments Symbol | Meaning | Description :--|:--|:-- ✅ | Supported | The provider has been validated to work on the platform.
An asterisk '*' indicates that some provider properties may have software or hardware limitations, caveats, or other noted behaviors.
Click on the associated caveat link for more information. -:heavy_minus_sign: | Not Applicable | The provider is not supported on the platform because of hardware or software limitations. +➖ | Not Applicable | The provider is not supported on the platform because of hardware or software limitations. **Support Matrix** -| ✅ = Supported
:heavy_minus_sign: = Not Applicable | N9k | N3k | N5k | N6k | N7k | N9k-F | Caveats | +| ✅ = Supported
➖ = Not Applicable | N9k | N3k | N5k | N6k | N7k | N9k-F | Caveats | |:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:| | [cisco_aaa_
authentication_login](#type-cisco_aaa_authentication_login) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_aaa_
authorization_login_cfg_svc](#type-cisco_aaa_authorization_login_cfg_svc) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | @@ -412,29 +416,30 @@ Symbol | Meaning | Description | [cisco_command_config](#type-cisco_command_config) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_bgp](#type-cisco_bgp) | ✅ | ✅ | ✅* | ✅* | ✅* | ✅ | \*[caveats](#cisco_bgp-caveats) | | [cisco_bgp_af](#type-cisco_bgp_af) | ✅* | ✅* | ✅ | ✅* | ✅ | ✅ | \*[caveats](#cisco_bgp_af-caveats) | +| [cisco_bgp_af_aa](#type-cisco_bgp_af_aa) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_bgp_neighbor](#type-cisco_bgp_neighbor) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_bgp_neighbor_af](#type-cisco_bgp_neighbor_af) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [cisco_bridge_domain](#type-cisco_bridge_domain) | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | -| [cisco_bridge_domain_vni](#type-cisco_bridge_domain_vni) | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | -| [cisco_dhcp_relay_global](#type-cisco_dhcp_relay_global) | ✅* | ✅* | ✅* | ✅* | ✅* | ✅* | \*[caveats](#cisco_dhcp_relay_global-caveats) -| [cisco_encapsulation](#type-cisco_encapsulation) | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | -| [cisco_evpn_vni](#type-cisco_evpn_vni) | ✅ | :heavy_minus_sign: | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_evpn_vni-caveats) | -| [cisco_fabricpath_global](#type-cisco_fabricpath_global) | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | ✅ | ✅* | :heavy_minus_sign: | \*[caveats](#cisco_fabricpath_global-caveats) | -| [cisco_fabricpath_topology](#type-cisco_fabricpath_topology) | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | ✅ | ✅ | :heavy_minus_sign: | +| [cisco_bridge_domain](#type-cisco_bridge_domain) | ➖ | ➖ | ➖ | ➖ | ✅ | ➖ | +| [cisco_bridge_domain_vni](#type-cisco_bridge_domain_vni) | ➖ | ➖ | ➖ | ➖ | ✅ | ➖ | +| [cisco_dhcp_relay_global](#type-cisco_dhcp_relay_global) | ✅* | ✅* | ✅* | ✅* | ✅* | ✅* | \*[caveats](#cisco_dhcp_relay_global-caveats) +| [cisco_encapsulation](#type-cisco_encapsulation) | ➖ | ➖ | ➖ | ➖ | ✅ | ➖ | +| [cisco_evpn_vni](#type-cisco_evpn_vni) | ✅ | ➖ | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_evpn_vni-caveats) | +| [cisco_fabricpath_global](#type-cisco_fabricpath_global) | ➖ | ➖ | ✅ | ✅ | ✅* | ➖ | \*[caveats](#cisco_fabricpath_global-caveats) | +| [cisco_fabricpath_topology](#type-cisco_fabricpath_topology) | ➖ | ➖ | ✅ | ✅ | ✅ | ➖ | | [cisco_hsrp_global](#type-cisco_hsrp_global) | ✅ | ✅* | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_hsrp_global-caveats) | | [cisco_interface](#type-cisco_interface) | ✅* | ✅* | ✅* | ✅* | ✅* | ✅* | \*[caveats](#cisco_interface-caveats) | -| [cisco_interface_channel_group](#type-cisco_interface_channel_group) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [cisco_interface_hsrp_group](#type-cisco_interface_hsrp_group) | ✅ | ✅ | :heavy_minus_sign: | :heavy_minus_sign: | ✅* | ✅ | \*[caveats](#cisco_interface_hsrp_group-caveats) | +| [cisco_interface_channel_group](#type-cisco_interface_channel_group) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_interface_channel_group-caveats) | +| [cisco_interface_hsrp_group](#type-cisco_interface_hsrp_group) | ✅ | ✅ | ➖ | ➖ | ✅* | ✅ | \*[caveats](#cisco_interface_hsrp_group-caveats) | | [cisco_interface_ospf](#type-cisco_interface_ospf) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_interface_portchannel](#type-cisco_interface_portchannel) | ✅* | ✅* | ✅* | ✅* | ✅* | ✅ | \*[caveats](#cisco_interface_portchannel-caveats) | -| [cisco_interface_service_vni](#type-cisco_interface_service_vni) | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | -| [cisco_itd_device_group](#type-cisco_itd_device_group) | ✅ | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | -| [cisco_itd_device_group_node](#type-cisco_itd_device_group_node) | ✅ | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | -| [cisco_itd_service](#type-cisco_itd_service) | ✅ | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | \*[caveats](#cisco_itd_service-caveats) | +| [cisco_interface_service_vni](#type-cisco_interface_service_vni) | ➖ | ➖ | ➖ | ➖ | ✅ | ➖ | +| [cisco_itd_device_group](#type-cisco_itd_device_group) | ✅ | ➖ | ➖ | ➖ | ✅ | ➖ | +| [cisco_itd_device_group_node](#type-cisco_itd_device_group_node) | ✅ | ➖ | ➖ | ➖ | ✅ | ➖ | +| [cisco_itd_service](#type-cisco_itd_service) | ✅ | ➖ | ➖ | ➖ | ✅ | ➖ | \*[caveats](#cisco_itd_service-caveats) | | [cisco_ospf](#type-cisco_ospf) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_ospf_vrf](#type-cisco_ospf_vrf) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| ✅ = Supported
:heavy_minus_sign: = Not Applicable | N9k | N3k | N5k | N6k | N7k | N9k-F | Caveats | -| [cisco_overlay_global](#type-cisco_overlay_global) | ✅ | :heavy_minus_sign: | ✅ | ✅ | ✅ | ✅ | +| ✅ = Supported
➖ = Not Applicable | N9k | N3k | N5k | N6k | N7k | N9k-F | Caveats | +| [cisco_overlay_global](#type-cisco_overlay_global) | ✅ | ✅* | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_overlay_global-caveats) | | [cisco_pim](#type-cisco_pim) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_pim-caveats) | | [cisco_pim_rp_address](#type-cisco_pim_rp_address) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_pim_grouplist](#type-cisco_pim_grouplist) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | @@ -447,19 +452,19 @@ Symbol | Meaning | Description | [cisco_snmp_user](#type-cisco_snmp_user) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_tacacs_server](#type-cisco_tacacs_server) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [cisco_tacacs_server_host](#type-cisco_tacacs_server_host) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [cisco_upgrade](type-cisco_upgrade) | ✅* | ✅* | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign:| \*[caveats](#cisco_upgrade-caveats) | -| [cisco_vdc](#type-cisco_vdc) | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | ✅ | :heavy_minus_sign: | +| [cisco_upgrade](type-cisco_upgrade) | ✅* | ✅* | ➖ | ➖ | ➖ | ✅* | \*[caveats](#cisco_upgrade-caveats) | +| [cisco_vdc](#type-cisco_vdc) | ➖ | ➖ | ➖ | ➖ | ✅ | ➖ | | [cisco_vlan](#type-cisco_vlan) | ✅* | ✅* | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_vlan-caveats) | -| [cisco_vpc_domain](#type-cisco_vpc_domain) | ✅* | ✅* | ✅* | ✅* | ✅* | :heavy_minus_sign: | \*[caveats](#cisco_vpc_domain-caveats) | +| [cisco_vpc_domain](#type-cisco_vpc_domain) | ✅* | ✅* | ✅* | ✅* | ✅* | ➖ | \*[caveats](#cisco_vpc_domain-caveats) | | [cisco_vrf](#type-cisco_vrf) | ✅ | ✅* | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_vrf-caveats) | | [cisco_vrf_af](#type-cisco_vrf_af) | ✅ | ✅* | ✅* | ✅* | ✅* | ✅ | \*[caveats](#cisco_vrf_af-caveats) | | [cisco_vtp](#type-cisco_vtp) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [cisco_vxlan_vtep](#type-cisco_vxlan_vtep) | ✅ | :heavy_minus_sign: | ✅ | ✅ | ✅ | ✅ | -| [cisco_vxlan_vtep_vni](#type-cisco_vxlan_vtep_vni) | ✅ | :heavy_minus_sign: | ✅ | ✅ | ✅ | ✅ | +| [cisco_vxlan_vtep](#type-cisco_vxlan_vtep) | ✅ | ➖ | ✅ | ✅ | ✅* | ✅ | \*[caveats](#cisco_vxlan_vtep-caveats) | +| [cisco_vxlan_vtep_vni](#type-cisco_vxlan_vtep_vni) | ✅ | ➖ | ✅ | ✅ | ✅ | ✅ | \*[caveats](#cisco_vxlan_vtep_vni-caveats) | ##### NetDev Providers -| ✅ = Supported
:heavy_minus_sign: = Not Applicable | N9k | N3k | N5k | N6k | N7k | N9k-F | Caveats | +| ✅ = Supported
➖ = Not Applicable | N9k | N3k | N5k | N6k | N7k | N9k-F | Caveats | |:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:| | [domain_name](#type-domain_name) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [name_server](#type-name_server) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | @@ -468,8 +473,9 @@ Symbol | Meaning | Description | [network_snmp](#type-network_snmp) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [network_trunk](#type-network_trunk) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [network_vlan](#type-network_vlan) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [ntp_config](#type-ntp_config) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| [ntp_server](#type-ntp_server) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [ntp_auth_key](#type-ntp_auth_key) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| [ntp_config](#type-ntp_config) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | \*[caveats](#ntp_config-caveats) +| [ntp_server](#type-ntp_server) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | \*[caveats](#ntp_server-caveats) | [port_channel](#type-port_channel) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [radius](#type-radius) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | [radius_global](#type-radius_global) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | @@ -972,7 +978,7 @@ Manages configuration of a BFD (Bidirectional Forwarding Detection) instance. | `fabricpath_interval` | Not supported on N3k, N9k-F, N9k | | `fabricpath_slow_timer` | Not supported on N3k, N9k-F, N9k | | `fabricpath_vlan` | Not supported on N3k, N9k-F, N9k | -| `interval` | Not supported on N9k-F, N9k | +| `interval` | Supported on N3k, N5k, N6k, N7k
Supported in OS Version 7.0(3)F2(1) and later on N9k-F
Supported in OS Version 7.0(3)I6(1) and later on N9k | | `ipv4_echo_rx_interval` | Not supported on N5k, N6k | | `ipv4_interval` | Not supported on N5k, N6k | | `ipv4_slow_timer` | Not supported on N5k, N6k | @@ -1053,14 +1059,14 @@ Manages configuration of a BGP instance. | Property | Caveat Description | |:--------|:-------------| -| `disable_policy_batching_ipv4` | Not supported on N5k, N6k, N7k | -| `disable_policy_batching_ipv6` | Not supported on N5k, N6k, N7k | +| `disable_policy_batching_ipv4` | Not supported on N5k, N6k
Supported in OS Version 8.1.1 and later on N7k | +| `disable_policy_batching_ipv6` | Not supported on N5k, N6k
Supported in OS Version 8.1.1 and later on N7k | | `event_history_errors ` | supported on N3|9k on 7.0(3)I5(1) and later images | | `event_history_events ` | default value is 'large' for N3|9k on 7.0(3)I5(1) and later images | | `event_history_objstore ` | supported on N3|9k on 7.0(3)I5(1) and later images | | `event_history_periodic ` | default value is 'false' for N3|9k on 7.0(3)I5(1) and later images | -| `neighbor_down_fib_accelerate` | Not supported on N5k, N6k, N7k | -| `reconnect_interval` | Not supported on N5k, N6k, N7k | +| `neighbor_down_fib_accelerate` | Not supported on N5k, N6k
Supported in OS Version 8.1.1 and later on N7k | +| `reconnect_interval` | Not supported on N5k, N6k
Supported in OS Version 8.1.1 and later on N7k | | `suppress_fib_pending` | Idempotence supported only on 7.0(3)I5(1) and later images N3|9k | #### Parameters @@ -1384,6 +1390,58 @@ Apply table-map to filter routes downloaded into URIB. Valid values are a string ##### `table_map_filter` Filters routes rejected by the route-map and does not download them to the RIB. Valid values are true, false, or 'default'. +-- +### Type: cisco_bgp_af_aa + +Manages configuration of a BGP Address-family Aggregate-address instance. + +| Platform | OS Minimum Version | Module Minimum Version | +|----------|:------------------:|:----------------------:| +| N9k | 7.0(3)I2(5) | 1.7.0 | +| N3k | 7.0(3)I2(5) | 1.7.0 | +| N5k | 7.3(0)N1(1) | 1.7.0 | +| N6k | 7.3(0)N1(1) | 1.7.0 | +| N7k | 7.3(0)D1(1) | 1.7.0 | +| N9k-F | 7.0(3)F1(1) | 1.7.0 | + +#### Parameters + +###### `ensure` +Determine whether the BGP address family aggregate address should be present or not. Valid values + are 'present' and 'absent'. + +##### `asn` +BGP autonomous system number. Required. Valid values are String, Integer in ASPLAIN or ASDOT notation. + +##### `vrf` +VRF name. Required. Valid values are string. The name 'default' is a valid VRF representing the global bgp. + +##### `afi` +Address Family Identifier (AFI). Required. Valid values are `ipv4`, `ipv6`, `vpnv4`, `vpnv6` and `l2vpn`. + +##### `safi` +Sub Address Family Identifier (SAFI). Required. Valid values are `unicast`, `multicast` and `evpn`. + +##### `aa` +Aggregate address mask in ipv4/ipv6 format. Required. Valid values are string. Examples: 1.1.1.1/32 or 2000:1/128. + +#### Properties + +##### `as_set` +Generates autonomous system set path information. Valid values are true, false or 'default'. + +##### `advertise_map` +Name of the route map used to select the routes to create AS_SET origin communities. Valid values are string or 'default'. + +##### `attribute_map` +Name of the route map used to set the attribute of the aggregate route. Valid values are string or 'default'. + +##### `summary_only` +Filters all more-specific routes from updates. Valid values are true, false or 'default'. + +##### `suppress_map` +Name of the route map used to select the routes to be suppressed. Valid values are string or 'default'. + -- ### Type: cisco_bgp_neighbor @@ -1402,7 +1460,7 @@ Manages configuration of a BGP Neighbor. | Property | Caveat Description | |:--------|:-------------| -| `log_neighbor_changes` | Not supported on N5k, N6k, N7k | +| `log_neighbor_changes` | Not supported on N5k, N6k
Minimum puppet module version 1.7.0 for N7k
Supported in OS Version 8.1.1 and later on N7k | | `bfd` | (ciscopuppet v1.4.0) BFD support added for all platforms | | `bfd` on IPv6 | Not supported on N5k, N6k | @@ -1689,7 +1747,7 @@ Manages configuration of a DHCP relay global configuration. | `ipv4_information_trust_all` | Not supported on N5k, N6k | | `ipv4_src_addr_hsrp` | Not supported on N3k, N9k, N9k-F | | `ipv4_sub_option_circuit_id_custom` | Not supported on N7k, N9k-F(TBD) and supported on N3k and N9k running os version 7.0(3)I3.1 and later | -| `ipv4_sub_option_circuit_id_string` | Only supported on N3k | +| `ipv4_sub_option_circuit_id_string` | Supported on N3k
Supported in OS Version 7.0(3)I6(1) and later on N9k | | `ipv6_option_cisco` | Not supported on N5k, N6k | #### Parameters @@ -1996,6 +2054,7 @@ Manages a Cisco Network Interface. Any resource dependency should be run before | `load_interval_counter_1_delay` | Minimum puppet module version 1.6.0 | | `load_interval_counter_2_delay` | Minimum puppet module version 1.6.0 | | `load_interval_counter_3_delay` | Minimum puppet module version 1.6.0 | +| `purge_config` | Minimum puppet module version 1.7.0 | #### Parameters @@ -2020,6 +2079,17 @@ Description of the interface. Valid values are a string or the keyword 'default' ###### `duplex` Duplex of the interface. Valid values are 'full', and 'auto'. +###### `purge_config` +Puts the ethernet interface into default state. Valid value is 'true'. When this property is set to 'true', the manifest can have no other properties. + +#### Example Usage + +```puppet +cisco_interface { 'ethernet1/10': + purge_config => true, + } +``` + ###### `speed` Speed of the interface. Valid values are 100, 1000, 10000, 40000, 1000000, and 'auto'. @@ -2325,6 +2395,12 @@ Manages a Cisco Network Interface Channel-group. | N7k | 7.3(0)D1(1) | 1.3.0 | | N9k-F | 7.0(3)F1(1) | 1.5.0 | +#### Caveats + +| Property | Caveat Description | +|:---------|:-------------| +| `channel_group_mode` | Minimum puppet module version 1.7.0 | + #### Parameters ##### Basic interface channel-group config attributes @@ -2340,6 +2416,9 @@ channel_group is an aggregation of multiple physical interfaces that creates a l Note: On some platforms a normal side-effect of adding the channel-group property is that an independent port-channel interface will be created; however, removing the channel-group configuration by itself will not also remove the port-channel interface. Therefore, the port-channel interface itself may be explicitly removed by using the `cisco_interface` provider with `ensure => absent`. +###### `channel_group_mode` +channel_group_mode is the port-channel mode of the interface. Valid values are 'active', 'passive', 'on', and 'default'. + ###### `description` Description of the interface. Valid values are a string or the keyword 'default'. @@ -3075,12 +3154,22 @@ Also configures anycast gateway MAC of the switch. | Platform | OS Minimum Version | Module Minimum Version | |----------|:------------------:|:----------------------:| | N9k | 7.0(3)I2(1) | 1.2.0 | -| N3k | not applicable | not applicable | +| N3k | 7.0(3)I6(1) | 1.7.0 | | N5k | 7.3(0)N1(1) | 1.3.0 | | N6k | 7.3(0)N1(1) | 1.3.0 | | N7k | 7.3(0)D1(1) | 1.3.0 | | N9k-F | 7.0(3)F1(1) | 1.5.0 | +#### Caveats + +| Property | Caveat Description | +|:--------|:-------------| +| `anycast_gateway_mac ` | Not supported on N3k | +| `dup_host_ip_addr_detection_host_moves` | Not supported on N3k | +| `dup_host_ip_addr_detection_timeout` | Not supported on N3k | +| `dup_host_mac_detection_host_moves` | Supported in OS Version 7.0(3)I6(1) and later on N3k | +| `dup_host_mac_detection_timeout` | Supported in OS Version 7.0(3)I6(1) and later on N3k | + #### Parameters ##### `name` @@ -3274,12 +3363,12 @@ Manages a Cisco Route Map. | `match_evpn_route_type_all` | Not supported on N3k,N9k-F,N9k | | `match_length` | Not supported on N3k,N9k-F,N9k | | `match_mac_list` | Not supported on N3k,N9k-F,N9k | -| `match_metric` | Not supported on N9k-F | +| `match_metric` | Supported in OS Version 7.0(3)F2(1) and later on N9k-F | | `match_ospf_area` | Not supported on N5k,N6k,N7k,N9k-F
Supported in OS version 7.0(3)I5.1 and later on N3k, N9k | | `match_vlan` | Not supported on N3k,N9k-F,N9k | -| `set_extcommunity_4bytes_additive` | Not supported on N9k-F | -| `set_extcommunity_4bytes_non_transitive` | Not supported on N9k-F | -| `set_extcommunity_4bytes_transitive` | Not supported on N9k-F | +| `set_extcommunity_4bytes_additive` | Supported in OS Version 7.0(3)F2(1) and later on N9k-F | +| `set_extcommunity_4bytes_non_transitive` | Supported in OS Version 7.0(3)F2(1) and later on N9k-F | +| `set_extcommunity_4bytes_transitive` | Supported in OS Version 7.0(3)F2(1) and later on N9k-F | | `set_extcommunity_cost_igp` | Not supported on N9k-F | | `set_extcommunity_cost_pre_bestpath` | Not supported on N9k-F | | `set_extcommunity_rt_additive` | Not supported on N9k-F | @@ -3288,15 +3377,14 @@ Manages a Cisco Route Map. | `set_ipv4_default_next_hop` | Not supported on N5k,N6k,N9k-F,N9k | | `set_ipv4_default_next_hop_load_share` | Not supported on N5k,N6k,N9k-F,N9k | | `set_ipv4_next_hop` | Not supported on N9k-F | -| `set_ipv4_next_hop_load_share` | Not supported on N5k,N6k,N9k-F
Supported in OS Version 7.0(3)I5.1 and later on N9k | +| `set_ipv4_next_hop_load_share` | Not supported on N5k,N6k
Supported in OS Version 7.0(3)I5.1 and later on N9k
Supported in OS Version 7.0(3)F2(1) and later on N9k-F | | `set_ipv4_next_hop_redist` | Supported on N5k,N6k,N7k,N9k-F
Supported in OS Version 7.0(3)I5.1 and later on N3k,N9k | | `set_ipv4_precedence` | Not supported on N9k-F | | `set_ipv4_prefix` | Not supported on N5k,N6k,N9k-F | -OS Version 7.0(3)I5.1 and later on N3k,N9k | | `set_ipv6_default_next_hop` | Not supported on N5k,N6k,N9k-F,N9k | | `set_ipv6_default_next_hop_load_share` | Not supported on N5k,N6k,N9k-F,N9k | | `set_ipv6_next_hop` | Not supported on N9k-F | -| `set_ipv6_next_hop_load_share` | Not supported on N5k,N6k,N9k-F
Supported in OS Version 7.0(3)I5.1 and later on N9k | +| `set_ipv6_next_hop_load_share` | Not supported on N5k,N6k
Supported in OS Version 7.0(3)I5.1 and later on N9k
Supported in OS Version 7.0(3)F2(1) and later on N9k-F | | `set_ipv6_next_hop_redist` | Supported on N5k,N6k,N7k,N9k-F
Supported in OS Version 7.0(3)I5.1 and later on N3k,N9k | | `set_ipv6_prefix` | Not supported on N5k,N6k,N9k-F | | `set_vrf` | Supported on N7k | @@ -3691,7 +3779,7 @@ Manages spanning tree global parameters | `bd_max_age` | Supported only on N7k | | `bd_priority` | Supported only on N7k | | `bd_root_priority` | Supported only on N7k | -| `domain` | Supported only on N5k, N6k, N7k | +| `domain` | Supported only on N5k, N6k, N7k
Supported in OS Version 7.0(3)I6(1) and later on N3k, N9k | | `fcoe` | Supported only on N9k | #### Parameters @@ -4029,11 +4117,11 @@ Manages the upgrade of a Cisco device. #### Caveats -The `cisco_upgrade` is only supported on *simplex* N3k, N9k and N9k-F devices. HA devices are currently not supported. +The `cisco_upgrade` is only supported on *simplex* N3k, N9k and N9k-F devices. HA devices are currently not supported. | Property | Caveat Description | |:--------|:-------------| -| `source_uri` | Only images on `bootflash:` are supported. The puppet file provider can be used to copy the image file to `bootflash`. Refer to Demo Upgrade for an example. | +| `package` | Only images on `bootflash`, `tftp` and `usb` (if available) are supported. The puppet file provider can be used to copy the image file to `bootflash`. Refer to Demo Upgrade for an example. | #### Parameters @@ -4041,11 +4129,6 @@ The `cisco_upgrade` is only supported on *simplex* N3k, N9k and N9k-F devices. H Name of cisco_upgrade instance. Valid values are string. *Only 'image' is a valid name for the cisco_upgrade resource.* -##### `source_uri` -Image upgrade URI. Format `:`. Valid values are string. -*Example --> bootflash:nxos.7.0.3.I5.2.bin* -*NOTE: Only images on `bootflash:` are supported.* - ##### `delete_boot_image` Delete the booted image. Valid values are `true`, `false`. @@ -4054,8 +4137,11 @@ Force upgrade the device.Valid values are `true`, `false`. #### Properties -##### `version` -Version of the Cisco image to install on the device. Valid values are strings. +##### `package` +Package to install on the device. Format `:`. Valid values are strings. +*Example --> bootflash:nxos.7.0.3.I5.2.bin + --> tftp://x.x.x.x/path/to/nxos.7.0.3.I5.2.bin* +*NOTE: Only images on `bootflash:`, `tftp:` and `usb` (if available) are supported.* -- ### Type: cisco_vdc @@ -4169,11 +4255,11 @@ Manages the virtual Port Channel (vPC) domain configuration of a Cisco device. | `auto_recovery` | Only supported on N3k, N7k, N9k | | `fabricpath_emulated_switch_id` | Only supported on N7k | | `fabricpath_multicast_load_balance` | Only supported on N7k | -| `layer3_peer_routing` | Only supported on N5k, N6k, N7k | +| `layer3_peer_routing` | Only supported on N5k, N6k, N7k
Supported in OS Version 7.0(3)I6(1) and later on N3k, N9k | | `peer_gateway_exclude_vlan` | Only supported on N5k, N6k, N7k | | `port_channel_limit` | Only supported on N7k | | `self_isolation` | Only supported on N7k | -| `shutdown` | Only supported on N5k, N6k, N7k | +| `shutdown` | Only supported on N5k, N6k, N7k
Supported in OS Version 7.0(3)I6(1) and later on N3k, N9k | #### Parameters @@ -4187,20 +4273,19 @@ vPC domain ID. Valid values are integer in the range 1-1000. There is no default Auto Recovery enable or disable if peer is non-operational. Valid values are true, false or default. This parameter is available only on Nexus 7000 series. Default value: true. ##### `auto_recovery_reload_delay` -Delay (in secs) before peer is assumed dead before attempting to recover vPCs. Valid values are integers in the range 240..3600. Default value: 240. +Delay (in secs) before peer is assumed dead before attempting to recover vPCs. Valid values are Integer or keyword 'default' ##### `delay_restore` -Delay (in secs) after peer link is restored to bring up vPCs. Valid values are integers in the range 1..3600. Default vlaue: 30. +Delay (in secs) after peer link is restored to bring up vPCs. Valid values are Integer or keyword 'default'. ##### `delay_restore_interface_vlan` -Delay (in secs) after peer link is restored to bring up Interface VLANs or Interface BDs. Valid values are integers in the -range 1..3600. Default value: 10. +Delay (in secs) after peer link is restored to bring up Interface VLANs or Interface BDs. Valid values are Integer or keyword 'default'. ##### `dual_active_exclude_interface_vlan_bridge_domain` -Interface VLANs or BDs to exclude from suspension when dual-active. Valid value is a string of integer ranges from 1..4095. There is no default value. +Interface VLANs or BDs to exclude from suspension when dual-active. Valid values are Integer or keyword 'default'. ##### `fabricpath_emulated_switch_id` -Configure a fabricpath switch_Id to enable vPC+ mode. This is also known as the Emulated switch-id. Valid values are integers in the range 1..4095. There is no default value. +Configure a fabricpath switch_Id to enable vPC+ mode. This is also known as the Emulated switch-id. Valid values are Integer or keyword 'default'. ##### `fabricpath_multicast_load_balance` In vPC+ mode, enable or disable the fabricpath multicast load balance. This loadbalances the Designated Forwarder selection for multicast traffic. Valid values are true, false or default @@ -4215,10 +4300,10 @@ Enable or Disable Layer3 peer routing. Valid values are true/false or default. D Destination IPV4 address of the peer where Peer Keep-alives are terminated. Valid values are IPV4 unicast address. There is no default value. ##### `peer_keepalive_hold_timeout` -Peer keep-alive hold timeout in secs. Valid Values are integers in the range 3..10. Default value: 3. +Peer keep-alive hold timeout in secs. Valid values are Integer or keyword 'default'. ##### `peer_keepalive_interval` -Peer keep-alive interval in millisecs. Valid Values are integers in the range 400..10000. Default value: 1000. +Peer keep-alive interval in millisecs. Valid values are Integer or keyword 'default'. ##### `peer_keepalive_interval_timeout` Peer keep-alive interval timeout. Valid Values are integers in the range 3..20. Default value: 5. @@ -4462,6 +4547,12 @@ Creates a VXLAN Network Virtualization Endpoint (NVE) overlay interface that ter | N7k | 7.3(0)D1(1) | 1.3.0 | | N9k-F | 7.0(3)F1(1) | 1.5.0 | +#### Caveats + +| Property | Caveat Description | +|---------------------------------|--------------------------------------| +| source_interface_hold_down_time | Not supported on N3k, N5k, N6k
Supported in OS Version 8.1.1 and later on N7k | + #### Parameters ##### `ensure` @@ -4495,6 +4586,14 @@ Creates a Virtual Network Identifier member (VNI) for an NVE overlay interface. | N7k | 7.3(0)D1(1) | 1.3.0 | | N9k-F | 7.0(3)F1(1) | 1.5.0 | +#### Caveats + +| Property | Caveat Description | +|---------------------------------|--------------------------------------| +| ingress_replication | Not supported on N3k, N5k, N6k
Supported in OS Version 8.1.1 and later on N7k | +| peer_list | Not supported on N3k, N5k, N6k
Supported in OS Version 8.1.1 and later on N7k | +| suppress_uuc | Not supported on N3k, N9k, N9k-F
Supported in OS Version 8.1.1 and later on N7k | + #### Parameters ##### `ensure` @@ -4521,6 +4620,9 @@ Set the ingress-replication static peer list. Valid values are an Array, a space ##### `suppress_arp` Suppress arp under layer 2 VNI. Valid values are true, false, or 'default'. +##### `suppress_uuc` +Suppress uuc under layer 2 VNI. Valid values are true, false, or 'default'. + -- ### NetDev StdLib Resource Type Details @@ -4722,6 +4824,32 @@ Whether or not the vlan is shutdown. Valid values are 'true' or 'false'. ###### `vlan_name` The name of the VLAN. Valid value is a string. +-- +### Type: ntp_auth_key + +| Platform | OS Minimum Version | Module Minimum Version | +|----------|:------------------:|:----------------------:| +| N9k | 7.0(3)I2(1) | 1.7.0 | +| N3k | 7.0(3)I2(1) | 1.7.0 | +| N5k | 7.3(0)N1(1) | 1.7.0 | +| N6k | 7.3(0)N1(1) | 1.7.0 | +| N7k | 7.3(0)D1(1) | 1.7.0 | +| N9k-F | 7.0(3)F1(1) | 1.7.0 | + +#### Parameters + +##### `algorithm` +Authentication scheme. Valid value is 'md5'. + +##### `key` +Authentication key number. Valid value is a string. + +##### `mode` +Authentication mode. Valid values are '0' and '7'. + +##### `password` +Authentication password. Valid value is a string. + -- ### Type: ntp_config @@ -4734,14 +4862,27 @@ The name of the VLAN. Valid value is a string. | N7k | 7.3(0)D1(1) | 1.3.0 | | N9k-F | 7.0(3)F1(1) | 1.5.0 | +#### Caveats + +| Property | Caveat Description | +|:--------|:-------------| +| `authenticate` | Module minimum version 1.7.0 | +| `trusted_key` | Module minimum version 1.7.0 | + #### Parameters +##### `authenticate` +Enable authentication. Valid values are 'true', 'false' and 'default'. + ##### `name` Resource name, not used to configure the device. Valid value is a string. ##### `source_interface` Source interface for the NTP server. Valid value is a string. +##### `trusted_key` +Trusted key for the NTP server. Valid value is integer. + -- ### Type: ntp_server @@ -4754,14 +4895,35 @@ Source interface for the NTP server. Valid value is a string. | N7k | 7.3(0)D1(1) | 1.3.0 | | N9k-F | 7.0(3)F1(1) | 1.5.0 | +#### Caveats + +| Property | Caveat Description | +|:--------|:-------------| +| `key` | Module minimum version 1.7.0 | +| `maxpoll` | Module minimum version 1.7.0 | +| `minpoll` | Module minimum version 1.7.0 | +| `vrf` | Module minimum version 1.7.0 | + #### Parameters ##### `ensure` Determines whether or not the config should be present on the device. Valid values are 'present' and 'absent'. +##### `key` +Key id to be used while communicating to this NTP. Valid value is an integer. + +##### `maxpoll` +Maximum interval to poll NTP server. Valid value is an integer. + +##### `minpoll` +Minimum interval to poll NTP server. Valid value is an integer. + ##### `name` Hostname or IPv4/IPv6 address of the NTP server. Valid value is a string. +##### `vrf` +Name of the vrf. Valid value is a string. + -- ### Type: port_channel diff --git a/docs/README-agent-install.md b/docs/README-agent-install.md index d58184bb4..cd474d644 100644 --- a/docs/README-agent-install.md +++ b/docs/README-agent-install.md @@ -530,7 +530,7 @@ Reference | Description [PUP_CR]: https://docs.puppetlabs.com/references/latest/configuration.html ## How to get a virtual Nexus N9k -A virtual Nexus N9k may be helpful for development and testing. To obtain a virtual N9k, first register for a [cisco.com](http://cisco.com) userid at , then send the userid in an email to . +A virtual Nexus N9k may be helpful for development and testing. To obtain a virtual N9k, first register for a [cisco.com](http://cisco.com) userid at , then download the software from [CCO](https://software.cisco.com/download/release.html?mdfid=286312239&softwareid=282088129&release=7.0(3)I5(2)&relind=AVAILABLE&rellifecycle=&reltype=latest). ## License diff --git a/docs/README-maintainers.md b/docs/README-maintainers.md index 747905768..39b5b8cbe 100644 --- a/docs/README-maintainers.md +++ b/docs/README-maintainers.md @@ -14,94 +14,73 @@ Guidelines for the core maintainers of the ciscopuppet project - above and beyon * Is the data still relevant? * Do the version dependencies need to be updated? (e.g. rubocop) -## Setting up git-flow +## Release Process Checklist -If you don't already have [`git-flow`](https://github.com/petervanderdoes/gitflow/) installed, install it. - -Either run `git flow init` from the repository root directory, or manually edit your `.git/config` file. Either way, when done, you should have the following in your config: - -```ini -[gitflow "branch"] - master = master - develop = develop -[gitflow "prefix"] - feature = feature/ - release = release/ - hotfix = hotfix/ - support = support/ - versiontag = v -``` - -Most of these are default for git-flow except for the `versiontag` setting. - -## Release Checklist +### Pre-Merge to `master` branch: When we are considering publishing a new release, all of the following steps must be carried out (using the latest code base in `develop`): -1. With the latest released `cisco_node_utils` gem (no development code! -released only! Do a new gem release first if needed!), run Beaker tests and -demo manifests against all supported platforms running latest OS release or -release candidate: - * N30xx - * N31xx - * N9xxx - -2. Triage any test failures. - -3. Make sure CHANGELOG.md accurately reflects all changes since the last release. - * Add any significant changes that weren't documented in the changelog - * Clean up any entries that are overly verbose, unclear, or otherwise could be improved. - -## Release Process - -When the release checklist above has been fully completed, the process for publishing a new release is as follows: - - -1. Ensure that tests have been executed against released Gem versions (release a new version if necessary!) and do not have dependencies on unreleased Gem code. - -2. Create a release branch. Follow [semantic versioning](http://semver.org): - * 0.0.x - a bugfix release - * 0.x.0 - new feature(s) - * x.0.0 - backward-incompatible change (only if unavoidable!) - - ``` - git flow release start 1.0.1 - ``` - -3. In the newly created release branch, update `CHANGELOG.md`: - - ```diff - -## [Unreleased] - +## [1.0.1] - 2015-08-28 - ... - +[1.0.1]: https://github.com/cisco/cisco-network-puppet-module/compare/v1.0.0...v1.0.1 - [1.0.0]: https://github.com/cisco/cisco-network-puppet-module/compare/v0.9.0...v1.0.0 - ``` - - and also update `metadata.json`: - - ```diff - "name": "puppetlabs-ciscopuppet", - - "version": "1.0.0", - + "version": "1.0.1", - "author": "cisco", - ``` - -4. Commit your changes and push the release branch to GitHub for review by Cisco and PuppetLabs: - - ``` - git flow release publish 1.0.1 - ``` - -5. Once Cisco and PuppetLabs are in agreement that the release branch is sane, finish the release and push the finished release to GitHub: - - ``` - git flow release finish 1.0.1 - git push origin master - git push origin develop - git push --tags - ``` - -6. Add release notes on GitHub, for example `https://github.com/cisco/cisco-network-puppet-module/releases/new?tag=v1.0.1`. Usually this will just be a copy-and-paste of the relevant section of the `CHANGELOG.md`. - -7. Reach out to PuppetLabs to publish the new module version to PuppetForge. +1. Pull release branch based on the `develop` branch. + * 0.0.x - a bugfix release + * 0.x.0 - new feature(s) + * x.0.0 - backward-incompatible change (if unvoidable!) + +1. Run full beaker test regression on [supported platforms.](https://github.com/cisco/cisco-network-puppet-module#resource-platform-support-matrix) + * Fix All Bugs. + * Make sure proper test case skips are in place for unsupported platforms. + * Ensure that tests have been executed against released Gem versions (release a new version if necessary!) and do not have dependencies on unreleased Gem code. + + +1. Update [changelog.](https://github.com/cisco/cisco-network-puppet-module/blob/develop/CHANGELOG.md) + * Make sure CHANGELOG.md accurately reflects all changes since the last release. + * Add any significant changes that weren't documented in the changelog + * Clean up any entries that are overly verbose, unclear, or otherwise could be improved. + * Indicate new platform support (if any) for exisiting providers. + * Create markdown release tag. + ```diff + -## [Unreleased] + +## [1.0.1] - 2015-08-28 + ... + +[1.0.1]: https://github.com/cisco/cisco-network-puppet-module/compare/v1.0.0...v1.0.1 + [1.0.0]: https://github.com/cisco/cisco-network-puppet-module/compare/v0.9.0...v1.0.0 + ``` + +1. Update [metadata.json](https://github.com/cisco/cisco-network-puppet-module/blob/develop/metadata.json) file. + * Update Version + ```diff + "name": "puppetlabs-ciscopuppet", + - "version": "1.0.0", + + "version": "1.0.1", + "author": "cisco", + ``` + * Update Supported OS Verions (if applicable) + +1. Update [`cisco_node_utils.rb` rec_version = Gem::Version.new('x.x.x')](https://github.com/cisco/cisco-network-puppet-module/blob/develop/lib/puppet/feature/cisco_node_utils.rb#L40) version. + +1. Verify/Update [netdev_stdlib version](https://github.com/cisco/cisco-network-puppet-module/blob/develop/metadata.json#L11) requirement if needed. + +1. Verify puppet module can be built using the [new puppet module version](https://github.com/cisco/cisco-network-puppet-module/blob/develop/metadata.json#L3). + +1. Scrub README Docs. + * Update references to indicate new platorm support where applicable. + * Update nxos release information where applicable. + * Update caveats for any new properties added in to existing/new providers. + +1. Open pull request from release branch against the `master` branch. + * Merge after approval. + +1. Reach out to PuppetLabs and ask them to verify new release branches (Puppet and NodeUtils) against their CI. + * **Important** Only after getting approval from puppet, move on to post-merge steps. + +### Post-Merge to `master` branch: + +1. Create annotated git tag for the release. + * [HowTo](https://git-scm.com/book/en/v2/Git-Basics-Tagging#Annotated-Tags) + +1. Draft a [new release](https://github.com/cisco/cisco-network-puppet-module/releases) on github. + +1. Merge `master` branch back into `develop` branch. + * Resolve any merge conflicts + * Optional: Delete release branch (May want to keep for reference) + +1. Reach out to PuppetLabs to publish the new module version to PuppetForge. diff --git a/examples/cisco/demo_bgp.pp b/examples/cisco/demo_bgp.pp index 1bcf59fdd..082583a05 100644 --- a/examples/cisco/demo_bgp.pp +++ b/examples/cisco/demo_bgp.pp @@ -207,6 +207,19 @@ redistribute => $ipv4_redistribute, } + cisco_bgp_af_aa { '55.77 default ipv4 unicast 1.1.1.1/32': + ensure => present, + as_set => true, + advertise_map => 'adm', + attribute_map => 'atm', + suppress_map => 'sum', + } + + cisco_bgp_af_aa { '55.77 default ipv4 unicast 2.2.2.2/32': + ensure => present, + summary_only => true, + } + if platform_get() != 'n3k' { cisco_bgp_af { '55.77 default l2vpn evpn': ensure => present, diff --git a/examples/cisco/demo_interface.pp b/examples/cisco/demo_interface.pp index 495ebf8b2..0c86bda90 100755 --- a/examples/cisco/demo_interface.pp +++ b/examples/cisco/demo_interface.pp @@ -74,7 +74,8 @@ } cisco_interface_channel_group { 'Ethernet1/2': - channel_group => 200, + channel_group => 200, + channel_group_mode => 'active', } cisco_interface { 'Ethernet1/3': @@ -130,19 +131,19 @@ } if platform_get() =~ /n7k/ { - cisco_bridge_domain { "100": - ensure => 'present', - shutdown => false, - bd_name => 'test1' + cisco_bridge_domain { '100': + ensure => 'present', + shutdown => false, + bd_name => 'test1' } cisco_interface { 'Bdi100': - require => Cisco_bridge_domain['100'], - ensure => 'present', - shutdown => false, - ipv4_address => "10.10.10.1", - ipv4_netmask_length => 24, - vrf => 'test1' + require => Cisco_bridge_domain['100'], + ensure => 'present', + shutdown => false, + ipv4_address => '10.10.10.1', + ipv4_netmask_length => 24, + vrf => 'test1' } } else { warning('This platform does not support cisco_bridge_domain') @@ -154,9 +155,9 @@ cisco_vlan { '2': pvlan_type => 'primary', pvlan_association => '12' } cisco_interface { 'Ethernet1/6': - description => 'Private-vlan Host Port', - switchport_pvlan_host => true, - switchport_pvlan_host_association => [2, 12], + description => 'Private-vlan Host Port', + switchport_pvlan_host => true, + switchport_pvlan_host_association => [2, 12], } cisco_vlan { '13': pvlan_type => 'isolated' } @@ -194,8 +195,8 @@ switchport_pvlan_mapping_trunk => $trunk_map, } cisco_interface { 'vlan29': - description => 'SVI Private-vlan Mapping', - pvlan_mapping => '108-109', + description => 'SVI Private-vlan Mapping', + pvlan_mapping => '108-109', } } else { warning('This platform does not support the private-vlan feature') diff --git a/examples/cisco/demo_upgrade.pp b/examples/cisco/demo_upgrade.pp index 7a1876044..960c4881d 100644 --- a/examples/cisco/demo_upgrade.pp +++ b/examples/cisco/demo_upgrade.pp @@ -28,13 +28,12 @@ # agent-lab9-pm:files:2011> node default { - $gem = 'cisco_node_utils-1.5.0.gem' + $gem = 'cisco_node_utils-1.6.0.gem' $uri = 'bootflash' $image = 'nxos.7.0.3.I2.5.bin' - $version = '7.0(3)I2(5)' - + # If you are behind proxy, please set the proxy variable. - # $proxy = 'http://.:' + # $proxy = 'http://.:' $proxy = '' if $proxy == '' { @@ -69,8 +68,7 @@ } cisco_upgrade { 'image' : - version => "${version}", - source_uri => "${uri}:///${image}", + package => "${uri}:///${image}", force_upgrade => false, delete_boot_image => false, } diff --git a/lib/facter/cisco.rb b/lib/facter/cisco.rb index 025fb7116..cc759fd26 100644 --- a/lib/facter/cisco.rb +++ b/lib/facter/cisco.rb @@ -13,11 +13,13 @@ hash['images'] = {} begin hash['images']['system_image'] = Platform.system_image + hash['images']['full_version'] = Platform.image_version rescue NameError # In more recent versions, Platform moved into the Cisco namespace. Platform = Cisco::Platform Feature = Cisco::Feature hash['images']['system_image'] = Platform.system_image + hash['images']['full_version'] = Platform.image_version end hash['images']['packages'] = Platform.packages diff --git a/lib/puppet/feature/cisco_node_utils.rb b/lib/puppet/feature/cisco_node_utils.rb index 6173654bb..65c8b45ff 100644 --- a/lib/puppet/feature/cisco_node_utils.rb +++ b/lib/puppet/feature/cisco_node_utils.rb @@ -37,7 +37,7 @@ def cisco_node_utils? @results['cisco_node_utils'] = test('cisco_node_utils', libs: ['cisco_node_utils']) if @results['cisco_node_utils'] - rec_version = Gem::Version.new('1.6.0') + rec_version = Gem::Version.new('1.7.0') gem_version = Gem::Version.new(CiscoNodeUtils::VERSION) if gem_version < rec_version warn "This module works best with version #{rec_version} of gem "\ diff --git a/lib/puppet/provider/cisco_bgp_af_aa/cisco.rb b/lib/puppet/provider/cisco_bgp_af_aa/cisco.rb new file mode 100644 index 000000000..2bd5aa372 --- /dev/null +++ b/lib/puppet/provider/cisco_bgp_af_aa/cisco.rb @@ -0,0 +1,185 @@ +# May, 2017 +# +# Copyright (c) 2017 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'cisco_node_utils' if Puppet.features.cisco_node_utils? + +begin + require 'puppet_x/cisco/autogen' +rescue LoadError # seen on master, not on agent + # See longstanding Puppet issues #4248, #7316, #14073, #14149, etc. Ugh. + require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', + 'puppet_x', 'cisco', 'autogen.rb')) +end + +Puppet::Type.type(:cisco_bgp_af_aa).provide(:cisco) do + desc 'The Cisco bgp_af_aa provider.' + + confine feature: :cisco_node_utils + defaultfor operatingsystem: :nexus + + mk_resource_methods + + BGP_AF_AA_NON_BOOL_PROPS = [ + :advertise_map, + :attribute_map, + :suppress_map, + ] + + BGP_AF_AA_BOOL_PROPS = [ + :as_set, + :summary_only, + ] + + BGP_AF_AA_ALL_PROPS = BGP_AF_AA_NON_BOOL_PROPS + BGP_AF_AA_BOOL_PROPS + PuppetX::Cisco::AutoGen.mk_puppet_methods(:non_bool, self, '@nu', + BGP_AF_AA_NON_BOOL_PROPS) + PuppetX::Cisco::AutoGen.mk_puppet_methods(:bool, self, '@nu', + BGP_AF_AA_BOOL_PROPS) + + def initialize(value={}) + super(value) + asn = @property_hash[:asn] + vrf = @property_hash[:vrf] + afi = @property_hash[:afi] + safi = @property_hash[:safi] + aa = @property_hash[:aa] + af = [afi.to_s, safi.to_s] + + @nu = Cisco::RouterBgpAFAggrAddr.aas[asn][vrf][af][aa] unless asn.nil? + @property_flush = {} + end + + def self.properties_get(asn, vrf, af, aa, nu_obj) + current_state = { + name: [asn, vrf, af.first, af.last, aa].join(' '), + asn: asn, + vrf: vrf, + afi: af.first, + safi: af.last, + aa: aa, + ensure: :present, + } + + # Call node_utils getter for each property + BGP_AF_AA_NON_BOOL_PROPS.each do |prop| + current_state[prop] = nu_obj.send(prop) + end + + BGP_AF_AA_BOOL_PROPS.each do |prop| + val = nu_obj.send(prop) + if val.nil? + current_state[prop] = nil + else + current_state[prop] = val ? :true : :false + end + end + new(current_state) + end # self.properties_get + + def self.instances + aa_objs = [] + Cisco::RouterBgpAFAggrAddr.aas.each do |asn, vrfs| + vrfs.each do |vrf, afs| + afs.each do |af, aas| + aas.each do |aa, nu_obj| + aa_objs << properties_get(asn, vrf, af, aa, nu_obj) + end + end + end + end + aa_objs + end # self.instances + + def self.prefetch(resources) + aas = instances + resources.keys.each do |name| + provider = aas.find do |aga| + aga.asn.to_s == resources[name][:asn].to_s && + aga.vrf == resources[name][:vrf] && + aga.afi.to_s == resources[name][:afi].to_s && + aga.safi.to_s == resources[name][:safi].to_s && + aga.aa.to_s == resources[name][:aa].to_s + end + resources[name].provider = provider unless provider.nil? + end + end + + def exists? + @property_hash[:ensure] == :present + end + + def create + @property_flush[:ensure] = :present + end + + def destroy + @property_flush[:ensure] = :absent + end + + def properties_set(new_obj=false) + BGP_AF_AA_ALL_PROPS.each do |prop| + next unless @resource[prop] + send("#{prop}=", @resource[prop]) if new_obj + unless @property_flush[prop].nil? + @nu.send("#{prop}=", @property_flush[prop]) if + @nu.respond_to?("#{prop}=") + end + end + # Custom set methods + aa_set + end + + def aa_set + attrs = {} + vars = [ + :advertise_map, + :attribute_map, + :suppress_map, + :as_set, + :summary_only, + ] + return unless vars.any? { |p| @property_flush.key?(p) } + # At least one var has changed, get all vals from manifest + vars.each do |p| + if @resource[p] == :default + attrs[p] = @nu.send("default_#{p}") + else + attrs[p] = @resource[p] + attrs[p] = PuppetX::Cisco::Utils.bool_sym_to_s(attrs[p]) + end + end + @nu.aa_set(attrs) + end + + def flush + if @property_flush[:ensure] == :absent + @nu.destroy + @nu = nil + else + # Create/Update + new_obj = false + if @nu.nil? + new_obj = true + @nu = Cisco::RouterBgpAFAggrAddr.new(@resource[:asn], + @resource[:vrf], + [@resource[:afi], + @resource[:safi]], + @resource[:aa]) + end + properties_set(new_obj) + end + end +end diff --git a/lib/puppet/provider/cisco_interface/cisco.rb b/lib/puppet/provider/cisco_interface/cisco.rb index 8f2ab8181..1884a1fc9 100644 --- a/lib/puppet/provider/cisco_interface/cisco.rb +++ b/lib/puppet/provider/cisco_interface/cisco.rb @@ -98,6 +98,7 @@ :ipv4_dhcp_smart_relay, :negotiate_auto, :pim_bfd, + :purge_config, :shutdown, :switchport_autostate_exclude, :switchport_pvlan_host, diff --git a/lib/puppet/provider/cisco_interface_channel_group/cisco.rb b/lib/puppet/provider/cisco_interface_channel_group/cisco.rb index e1cba5cd4..9de81425d 100644 --- a/lib/puppet/provider/cisco_interface_channel_group/cisco.rb +++ b/lib/puppet/provider/cisco_interface_channel_group/cisco.rb @@ -36,6 +36,7 @@ # Note: channel_group should always process first. INTF_CG_NON_BOOL_PROPS = [ :channel_group, + :channel_group_mode, :description, ] INTF_CG_BOOL_PROPS = [ @@ -119,6 +120,16 @@ def properties_set(new_interface=false) @nu.respond_to?("#{prop}=") end end + # custom setters which require one-shot multi-param setters + channel_group_mode_set + end + + def channel_group_mode_set + group = @property_flush[:channel_group] ? @property_flush[:channel_group] : @nu.channel_group + mode = @property_flush[:channel_group_mode] ? @property_flush[:channel_group_mode] : @nu.channel_group_mode + group = false if @resource[:channel_group] == :default + mode = false if @resource[:channel_group_mode] == :default + @nu.channel_group_mode_set(group, mode) end def flush diff --git a/lib/puppet/provider/cisco_upgrade/cisco.rb b/lib/puppet/provider/cisco_upgrade/cisco.rb index c6c187e4d..029e51075 100644 --- a/lib/puppet/provider/cisco_upgrade/cisco.rb +++ b/lib/puppet/provider/cisco_upgrade/cisco.rb @@ -40,7 +40,8 @@ mk_resource_methods UPGRADE_NON_BOOL_PROPS = [ - :version + :version, + :package, ] UPGRADE_ALL_PROPS = UPGRADE_NON_BOOL_PROPS @@ -60,6 +61,7 @@ def self.instances inst << new( name: 'image', + package: upgrade.package, version: upgrade.image_version) end @@ -69,14 +71,30 @@ def self.prefetch(resources) def version=(new_version) return if new_version.nil? + fail "The property 'version' has been deprecated." + end + + def package=(new_package) + return if new_package.nil? # Convert del_boot_image and force_upgrade from symbols # to Boolean Class - fail 'The source_uri parameter must be set in the manifest' if - @resource[:source_uri].nil? del_boot_image = (@resource[:delete_boot_image] == :true) force_upgrade = (@resource[:force_upgrade] == :true) - @nu.upgrade(new_version, @resource[:source_uri][:image_name], @resource[:source_uri][:uri], - del_boot_image, force_upgrade) - @property_hash[:version] = new_version + # The Node-utils API expects uri and image_name as two + # separate arguments. Pre-processing the arguments here. + pkg = @resource[:package] + if pkg.include?('/') + if pkg.include?('bootflash') || pkg.include?('usb') + uri = pkg.split('/')[0] + else + uri = pkg.rpartition('/')[0] + '/' + end + image_name = pkg.split('/')[-1] + else + uri = pkg.split(':')[0] + ':' + image_name = pkg.split(':')[-1] + end + @nu.upgrade(image_name, uri, del_boot_image, force_upgrade) + @property_hash[:package] = pkg end end diff --git a/lib/puppet/provider/ntp_auth_key/cisco.rb b/lib/puppet/provider/ntp_auth_key/cisco.rb new file mode 100644 index 000000000..2f2611b27 --- /dev/null +++ b/lib/puppet/provider/ntp_auth_key/cisco.rb @@ -0,0 +1,113 @@ +# April, 2017 +# +# Copyright (c) 2014-2017 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'cisco_node_utils' if Puppet.features.cisco_node_utils? + +begin + require 'puppet_x/cisco/autogen' +rescue LoadError # seen on master, not on agent + # See longstanding Puppet issues #4248, #7316, #14073, #14149, etc. Ugh. + require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', + 'puppet_x', 'cisco', 'autogen.rb')) +end + +Puppet::Type.type(:ntp_auth_key).provide(:cisco) do + desc 'The Cisco provider for ntp_auth_key.' + + confine feature: :cisco_node_utils + defaultfor operatingsystem: :nexus + + mk_resource_methods + + NTP_AUTH_KEY_ALL_PROPS = [ + :algorithm, + :mode, + :password, + ] + + def initialize(value={}) + super(value) + @ntpkey = Cisco::NtpAuthKey.ntpkeys[@property_hash[:name]] + @property_flush = {} + debug 'Created provider instance of ntp_auth_key' + end + + def self.properties_get(key, v) + debug "Checking instance, ntp_auth_key #{key}" + + current_state = { + name: key, + ensure: :present, + algorithm: v.algorithm, + mode: v.mode, + password: v.password, + } + + new(current_state) + end # self.properties_get + + def self.instances + ntpkeys = [] + Cisco::NtpAuthKey.ntpkeys.each do |key, v| + ntpkeys << properties_get(key, v) + end + + ntpkeys + end + + def self.prefetch(resources) + ntpkeys = instances + + resources.keys.each do |id| + provider = ntpkeys.find { |ntpserver| ntpserver.name == id.to_s } + resources[id].provider = provider unless provider.nil? + end + end # self.prefetch + + def exists? + @property_hash[:ensure] == :present + end + + def create + @property_flush[:ensure] = :present + end + + def destroy + @property_flush[:ensure] = :absent + end + + def flush + if @property_flush[:ensure] == :absent + @ntpkey.destroy + @ntpkey = nil + else + # Create/Update + # Create new instance with configured options + opts = { 'name' => @resource[:name] } + NTP_AUTH_KEY_ALL_PROPS.each do |prop| + next unless @resource[prop] + opts[prop.to_s] = @resource[prop].to_s + end + + begin + @ntpkey = Cisco::NtpAuthKey.new(opts) + rescue Cisco::CliError => e + error "Unable to set new values: #{e.message}" + end + end + # puts_config + end +end # Puppet::Type diff --git a/lib/puppet/provider/ntp_config/cisco.rb b/lib/puppet/provider/ntp_config/cisco.rb index 186c6477c..48961296d 100644 --- a/lib/puppet/provider/ntp_config/cisco.rb +++ b/lib/puppet/provider/ntp_config/cisco.rb @@ -1,6 +1,6 @@ # November, 2014 # -# Copyright (c) 2014-2016 Cisco and/or its affiliates. +# Copyright (c) 2014-2017 Cisco and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,9 +31,21 @@ mk_resource_methods - NTP_CONFIG_PROPS = { - source_interface: :source_interface - } + NTP_CONFIG_NON_BOOL_PROPS = [ + :source_interface, + :trusted_key, + ] + + NTP_CONFIG_BOOL_PROPS = [ + :authenticate + ] + + NTP_CONFIG_PROPS = NTP_CONFIG_NON_BOOL_PROPS + NTP_CONFIG_BOOL_PROPS + + PuppetX::Cisco::AutoGen.mk_puppet_methods(:non_bool, self, '@ntpconfig', + NTP_CONFIG_NON_BOOL_PROPS) + PuppetX::Cisco::AutoGen.mk_puppet_methods(:bool, self, '@ntpconfig', + NTP_CONFIG_BOOL_PROPS) def initialize(value={}) super(value) @@ -46,11 +58,28 @@ def self.properties_get(ntpconfig_name, v) debug "Checking instance, NtpConfig #{ntpconfig_name}" current_state = { - name: 'default', - source_interface: v.source_interface.nil? ? 'unset' : v.source_interface, - ensure: :present, + name: 'default', + ensure: :present, } + # Call node_utils getter for each property + NTP_CONFIG_NON_BOOL_PROPS.each do |prop| + val = v.send(prop) + if prop == :trusted_key + current_state[prop] = val ? val : ['unset'] + else + current_state[prop] = val ? val : 'unset' + end + end + NTP_CONFIG_BOOL_PROPS.each do |prop| + val = v.send(prop) + if val.nil? + current_state[prop] = nil + else + current_state[prop] = val ? :true : :false + end + end + debug current_state new(current_state) end # self.properties_get @@ -84,34 +113,56 @@ def validate return unless @resource[:source_interface] if @resource[:source_interface] =~ /\s+/ - fail ArgumentError, "The parameter 'source_interface' must not contain" \ + fail ArgumentError, "The parameter 'source_interface' must not contain " \ 'any spaces' end return unless @resource[:source_interface] =~ /[A-Z]+/ - fail ArgumentError, "The parameter 'source_interface' must not contain" \ + fail ArgumentError, "The parameter 'source_interface' must not contain " \ 'any uppercase characters' end - def munge_flush(val) - if val.is_a?(String) && val.eql?('unset') - nil - elsif val.is_a?(Symbol) - val.to_s + # Custom setters. + # The following properties are setters and cannot be handled + # by PuppetX::Cisco::AutoGen.mk_puppet_methods. + def ntp_trusted_keys + return unless @property_flush[:trusted_key] + # Get array of keys to remove + # If unset - remove all configured keys + if @property_flush[:trusted_key] == ['unset'] + remove = @property_hash[:trusted_key].map(&:to_s) else - val + # Otherwise calculate the delta + remove = @property_hash[:trusted_key].map(&:to_s).sort - + @property_flush[:trusted_key].map(&:to_s).sort + remove.delete('unset') + end + remove.each do |key| + @ntpconfig.trusted_key_set(false, key) unless key == 'unset' + end + # Get array of keys to add + return if @property_flush[:trusted_key] == ['unset'] + add = @property_flush[:trusted_key].map(&:to_s).sort - + @property_hash[:trusted_key].map(&:to_s).sort + remove.delete('unset') + add.each do |key| + @ntpconfig.trusted_key_set(true, key) end end def flush validate - - NTP_CONFIG_PROPS.each do |puppet_prop, cisco_prop| - if @resource[puppet_prop] - @ntpconfig.send("#{cisco_prop}=", munge_flush(@resource[puppet_prop])) if - @ntpconfig.respond_to?("#{cisco_prop}=") - end + NTP_CONFIG_PROPS.each do |prop| + next unless @resource[prop] + next if @property_flush[prop].nil? + # Call the AutoGen setters for the @ntpconfig + # node_utils object. + @property_flush[prop] = nil if @property_flush[prop] == 'unset' + @ntpconfig.send("#{prop}=", @property_flush[prop]) if + @ntpconfig.respond_to?("#{prop}=") end + # Set methods that are not autogenerated follow. + ntp_trusted_keys end end # Puppet::Type diff --git a/lib/puppet/provider/ntp_server/cisco.rb b/lib/puppet/provider/ntp_server/cisco.rb index c7c66856e..81ca3b68f 100644 --- a/lib/puppet/provider/ntp_server/cisco.rb +++ b/lib/puppet/provider/ntp_server/cisco.rb @@ -1,6 +1,6 @@ # November, 2014 # -# Copyright (c) 2014-2016 Cisco and/or its affiliates. +# Copyright (c) 2014-2017 Cisco and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,7 +32,11 @@ mk_resource_methods NTP_SERVER_ALL_PROPS = [ - :prefer + :key, + :prefer, + :maxpoll, + :minpoll, + :vrf, ] def initialize(value={}) @@ -46,14 +50,15 @@ def self.properties_get(ntpserver_ip, v) debug "Checking instance, ntpserver #{ntpserver_ip}" current_state = { - name: ntpserver_ip, - ensure: :present, + name: ntpserver_ip, + ensure: :present, + key: v.key, + prefer: v.prefer.to_s, + maxpoll: v.maxpoll, + minpoll: v.minpoll, + vrf: v.vrf, } - NTP_SERVER_ALL_PROPS.each do |prop| - current_state[prop] = v.send(prop) == true ? :true : :false - end - new(current_state) end # self.properties_get @@ -93,7 +98,26 @@ def flush @ntpserver = nil else # Create/Update - @ntpserver = Cisco::NtpServer.new(@resource[:name], @resource[:prefer] == :true ? true : false) + # NTP is a single line in the config and cannot be easily changed adhoc + # Remove existing config and set intended state + unless @ntpserver.nil? + # retain previous value to rollback if set fails + old_value = @ntpserver + @ntpserver.destroy + end + # Create new instance with configured options + opts = { 'name' => @resource[:name] } + NTP_SERVER_ALL_PROPS.each do |prop| + next unless @resource[prop] + opts[prop.to_s] = @resource[prop].to_s + end + + begin + @ntpserver = Cisco::NtpServer.new(opts) + rescue Cisco::CliError => e + error "Unable to set new values: #{e.message}" + old_value.create unless old_value.nil? + end end # puts_config end diff --git a/lib/puppet/provider/package/cisco.rb b/lib/puppet/provider/package/cisco.rb index 980f461c2..6e2ddcd72 100644 --- a/lib/puppet/provider/package/cisco.rb +++ b/lib/puppet/provider/package/cisco.rb @@ -232,7 +232,9 @@ def uninstall if in_guestshell? && target_host? debug 'Guestshell + target=>host detected, using nxapi for uninstall' if @resource[:platform] - Cisco::Yum.remove("#{@resource[:name]}.#{@resource[:platform]}") + # TODO: adding platform to the name is NOT working, for now just use name + # Cisco::Yum.remove("#{@resource[:name]}.#{@resource[:platform]}") + Cisco::Yum.remove(@resource[:name]) else Cisco::Yum.remove(@resource[:name]) end diff --git a/lib/puppet/provider/port_channel/cisco.rb b/lib/puppet/provider/port_channel/cisco.rb index 69b823549..c59d95a2a 100644 --- a/lib/puppet/provider/port_channel/cisco.rb +++ b/lib/puppet/provider/port_channel/cisco.rb @@ -65,7 +65,7 @@ def flush if @resource[:interfaces] @resource[:interfaces].each do |i| bla = Cisco::InterfaceChannelGroup.interfaces[i] - bla.channel_group = @resource[:id] if @resource[:id] + bla.channel_group_mode_set(@resource[:id]) if @resource[:id] end end end diff --git a/lib/puppet/type/cisco_bgp_af_aa.rb b/lib/puppet/type/cisco_bgp_af_aa.rb new file mode 100644 index 000000000..d97aaed29 --- /dev/null +++ b/lib/puppet/type/cisco_bgp_af_aa.rb @@ -0,0 +1,162 @@ +# Manages the Cisco Bgp_af_aa configuration resource. +# +# May 2017 +# +# Copyright (c) 2017 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'ipaddr' +begin + require 'puppet_x/cisco/cmnutils' +rescue LoadError # seen on master, not on agent + # See longstanding Puppet issues #4248, #7316, #14073, #14149, etc. Ugh. + require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', + 'puppet_x', 'cisco', 'cmnutils.rb')) +end + +Puppet::Type.newtype(:cisco_bgp_af_aa) do + @doc = "Manages a cisco BGP Address family aggregate address + + cisco_bgp_af_aa { '': + ..attributes.. + } + + `<title>` is the title of the bgp_af_aa resource + +Example: + + cisco_bgp_af_aa{ '55.77 default ipv4 multicast 1.1.1.1/32': + ensure => 'present', + as_set => 'true', + summary_only => 'false', + advertise_map => 'adm', + attribute_map => 'atm', + suppress_map => 'sum', + } + " + + ################### + # Resource Naming # + ################### + + # Parse out the title to fill in the attributes in these + # patterns. These attributes can be overwritten later. + def self.title_patterns + identity = ->(x) { x } + [ + [ + /^(\d+|\d+\.\d+) (\S+) (\S+) (\S+) (\S+)$/, + [ + [:asn, identity], + [:vrf, identity], + [:afi, identity], + [:safi, identity], + [:aa, identity], + ], + ] + ] + end + + ############## + # Parameters # + ############## + + ensurable + + # Overwrites the name method which by default returns only + # self[:name]. + def name + "#{self[:asn]} #{self[:vrf]} #{self[:afi]} #{self[:safi]} #{self[:aa]}" + end + + # Only needed to satisfy name parameter. + newparam(:name) do + end + + newparam(:asn, namevar: true) do + desc "BGP autonomous system number. Valid values are String, Integer in + ASPLAIN or ASDOT notation" + validate do |value| + unless /^(\d+|\d+\.\d+)$/.match(value.to_s) + fail("BGP asn #{value} must be specified in ASPLAIN or ASDOT notation") + end + end + + munge(&:to_s) + end + + newparam(:vrf, namevar: true) do + desc 'BGP vrf name. Valid values are string. ' \ + "The name 'default' is a valid VRF." + + defaultto('default') + newvalues(/^\S+$/) + end + + newparam(:afi, namevar: true) do + desc 'BGP Address-family AFI (ipv4|ipv6). Valid values are string.' + newvalues(:ipv4, :ipv6) + end + + newparam(:safi, namevar: true) do + desc 'BGP Address-family SAFI (unicast|multicast). Valid values are string.' + newvalues(:unicast, :multicast) + end + + newparam(:aa, namevar: true) do + desc 'BGP aggregate address prefix. Valid values are String.' + munge do |value| + begin + value = PuppetX::Cisco::Utils.process_network_mask(value) unless value.nil? + value + rescue + raise 'aggregate address must be in valid address/length format' + end + end + end + + ############## + # Attributes # + ############## + + newproperty(:as_set) do + desc "Generates autonomous system set path information. Valid values are true, false or 'default'" + + newvalues(:true, :false, :default) + end # property as_set + + newproperty(:summary_only) do + desc "Filters all more-specific routes from updates. Valid values are true, false or 'default'" + + newvalues(:true, :false, :default) + end # property summary_only + + newproperty(:advertise_map) do + desc "Name of the route map used to select the routes to create AS_SET origin communities. Valid values are String or 'default'" + + munge { |value| value == 'default' ? :default : value } + end # property advertise_map + + newproperty(:attribute_map) do + desc "Name of the route map used to set the attribute of the aggregate route. Valid values are String or 'default'" + + munge { |value| value == 'default' ? :default : value } + end # property attribute_map + + newproperty(:suppress_map) do + desc "Name of the route map used to select the routes to be suppressed. Valid values are String or 'default'" + + munge { |value| value == 'default' ? :default : value } + end # property suppress_map +end diff --git a/lib/puppet/type/cisco_interface.rb b/lib/puppet/type/cisco_interface.rb index 5b24e7c5c..d3e74f142 100755 --- a/lib/puppet/type/cisco_interface.rb +++ b/lib/puppet/type/cisco_interface.rb @@ -126,6 +126,9 @@ switchport_pvlan_trunk_allowed_vlan => '88-91,94', switchport_pvlan_trunk_native_vlan => 12, } + cisco_interface { 'ethernet8/2' : + purge_config => true, + } cisco_interface {'Vlan98': pvlan_mapping => '10-11,13', } @@ -1279,4 +1282,14 @@ def is_to_s(value) munge { |value| value == 'default' ? :default : Integer(value) } end # property load_interval_counter_3_delay + + newproperty(:purge_config) do + desc 'Puts the ethernet interface in default state.' + + newvalues(:true) + end + + validate do + fail ArgumentError, 'All params MUST be nil if purge_config is true' if self[:purge_config] == :true && properties.length > 2 + end end # Puppet::Type.newtype diff --git a/lib/puppet/type/cisco_interface_channel_group.rb b/lib/puppet/type/cisco_interface_channel_group.rb index bf6db0df3..e5438eef8 100644 --- a/lib/puppet/type/cisco_interface_channel_group.rb +++ b/lib/puppet/type/cisco_interface_channel_group.rb @@ -29,9 +29,10 @@ Example: cisco_interface_channel_group {'Ethernet1/15': - channel_group => 201, - description => 'my channel group', - shutdown => true, + channel_group => 201, + channel_group_mode => 'active', + description => 'myChannelGroup', + shutdown => true, } " @@ -69,6 +70,13 @@ def self.title_patterns munge { |value| value == 'default' ? :default : value.to_i } end # property channel_group + newproperty(:channel_group_mode) do + desc 'Port-channel mode of the interface. Valid values are string' + + munge { |value| value == 'on' || value == 'default' ? :default : value } + newvalues(:active, :passive, :on, :default) + end + newproperty(:description) do desc "Description of the interface. Valid values are string, keyword 'default'." @@ -84,4 +92,10 @@ def self.title_patterns newvalues(:true, :false, :default) end # property shutdown + + validate do + return unless self[:channel_group] == :default + fail ArgumentError, 'channel_group_mode MUST be default if channel_group_mode is default' unless + self[:channel_group_mode] == :default + end end # Puppet::Type.newtype diff --git a/lib/puppet/type/cisco_upgrade.rb b/lib/puppet/type/cisco_upgrade.rb index 3bf9cc55a..c6411dcf9 100644 --- a/lib/puppet/type/cisco_upgrade.rb +++ b/lib/puppet/type/cisco_upgrade.rb @@ -29,8 +29,7 @@ Example: ``` cisco_upgrade {'image' : - version => '7.0(3)I5(1)', - source_uri => 'bootflash:///nxos.7.0.3.I5.1.bin', + package => 'bootflash:///nxos.7.0.3.I5.1.bin', force_upgrade => false, delete_boot_image => false, } @@ -60,31 +59,6 @@ def self.title_patterns end end - newparam(:source_uri) do - examples = "\nExample:\nbootflash:nxos.7.0.3.I5.2.bin" - supported = "\nNOTE: Only bootflash: is supported." - desc "URI to the image to install on the device. Format <uri>:<image>. - Valid values are string.#{examples}#{supported}" - - validate do |uri| - fail 'source_uri must match format <uri>:<image>' unless uri[/\S+:\S+/] - end - munge do |uri| - image = {} - # Convert <uri>:<image> to a hash. - # The Node-utils API expects uri and image_name as two - # separate arguments. Pre-processing the arguments here. - if uri.include?('/') - image[:uri] = uri.split('/')[0] - image[:image_name] = uri.split('/')[-1] - else - image[:uri] = uri.split(':')[0] + ':' - image[:image_name] = uri.split(':')[-1] - end - image - end - end # param source_uri - newparam(:force_upgrade) do desc 'Force upgrade the device.' defaultto :false @@ -101,16 +75,33 @@ def self.title_patterns # Attributes # ############## + # Deprecated newproperty(:version) do desc 'Version of the Cisco image to install on the device. Valid values are strings' validate do |ver| - fail "Version can't be nil or an empty string" if - ver == '' || ver.nil? == :true valid_chars = 'Version can only have the following characters: 0-9, a-z, A-Z, (, ) and .' fail "Invalid version string. #{valid_chars}" unless (/([0-9a-zA-Z().]*)/.match(ver))[0] == ver end end # property version + + newproperty(:package) do + examples = "\nExample:\nbootflash:nxos.7.0.3.I5.2.bin\n + tftp://x.x.x.x/path/to/nxos.7.0.3.I5.2.bin\n + usb1:nxos.7.0.3.I5.2.bin" + supported = "\nNOTE: Only bootflash:,tftp: and usb are supported." + desc "{ackage to install on the device. Format <uri>:<image>. + Valid values are string.#{examples}#{supported}" + validate do |pkg| + fail 'Package should be a string.' unless pkg.is_a?(String) + fail 'package must match format <uri>:<image>' unless pkg[/\S+:\S+/] + end + end # property package + + validate do + fail "The property 'version' has been deprecated. Please use 'package'." if + self[:version] && self[:package].nil? + end end diff --git a/lib/puppet/type/cisco_vpc_domain.rb b/lib/puppet/type/cisco_vpc_domain.rb index 36db1be62..d8a6c35e0 100644 --- a/lib/puppet/type/cisco_vpc_domain.rb +++ b/lib/puppet/type/cisco_vpc_domain.rb @@ -2,7 +2,7 @@ # # January 2016 # -# Copyright (c) 2013-2016 Cisco and/or its affiliates. +# Copyright (c) 2013-2017 Cisco and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -112,39 +112,20 @@ def self.title_patterns end # property name newproperty(:auto_recovery_reload_delay) do - desc 'Delay (in secs) before peer is assumed dead before attempting to - recover VPCs. Valid values are integers in the range 240 .. 3600' - validate do |value| - if value != 'default' - fail('auto_recovery_reload_delay should be a value in the range - 240 .. 3600') unless value.to_i.between?(240, 3600) - end - end + desc "Delay (in secs) before peer is assumed dead before attempting to + recover VPCs. Valid values are Integer, keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name newproperty(:delay_restore) do - desc 'Delay (in secs) after peer link is restored to bring up VPCs - Valid values are integers in the range 240 .. 3600' - validate do |value| - if value != 'default' - fail('delay_restore should be a value in the range 240 .. 3600') unless - value.to_i.between?(240, 3600) - end - end + desc "Delay (in secs) after peer link is restored to bring up VPCs + Valid values are Integer, keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name newproperty(:delay_restore_interface_vlan) do - desc 'Delay (in secs) after peer link is restored to bring up Interface - VLANs or Interface BDs. Valid values are integers in the - range 240 .. 3600' - validate do |value| - if value != 'default' - fail('delay_restore should be a value in the range 240 .. 3600') unless - value.to_i.between?(240, 3600) - end - end + desc "Delay (in secs) after peer link is restored to bring up Interface + VLANs or Interface BDs. Valid values are Integer, keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name @@ -159,7 +140,7 @@ def self.title_patterns newproperty(:fabricpath_emulated_switch_id) do desc 'In vPC+ mode, configure the fabricpath switch-id aka the - Emulated switch-id. Valid values are integers in the range 1..4095' + Emulated switch-id. Valid value is an Integer' munge(&:to_i) end # property name @@ -191,50 +172,26 @@ def self.title_patterns end # property name newproperty(:peer_keepalive_hold_timeout) do - desc 'Peer keep-alive hold timeout in secs. Valid Values are integers in the - range 3..10' - validate do |value| - if value != 'default' - fail('pka hold_timeout should be a value in the range 3 .. 10') unless - value.to_i.between?(3, 10) - end - end + desc "Peer keep-alive hold timeout in secs. Valid values are Integer + or keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name newproperty(:peer_keepalive_interval) do - desc 'Peer keep-alive interval in millisecs. Valid Values are integers in - the range 400..10000' - validate do |value| - if value != 'default' - fail('pka interval should be a value in the range 400..10000') unless - value.to_i.between?(400, 10_000) - end - end + desc "Peer keep-alive interval in millisecs. Valid values are Integer + or keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name newproperty(:peer_keepalive_interval_timeout) do - desc 'Peer keep-alive interval timeout. Valid Values are integers in the - range 3..20' - validate do |value| - if value != 'default' - fail('pka interval timeout should be a value in the range 3..20') unless - value.to_i.between?(3, 20) - end - end + desc "Peer keep-alive interval timeout. Valid values are Integer + or keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name newproperty(:peer_keepalive_precedence) do - desc 'Peer keep-alive precedence. Valid Values are integers in the - range 0..7' - validate do |value| - if value != 'default' - fail('pka precedence should be a value in the range 0..7') unless - value.to_i.between?(0, 7) - end - end + desc "Peer keep-alive precedence. Valid Values are Integer + or keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name @@ -248,14 +205,8 @@ def self.title_patterns end # property name newproperty(:peer_keepalive_udp_port) do - desc 'Peer keep-alive udp port used for hellos. Valid Values are integers - in the range 1024..65000' - validate do |value| - if value != 'default' - fail('pka udp port should be a value in the range 1024..65000') unless - value.to_i.between?(1024, 65_000) - end - end + desc "Peer keep-alive udp port used for hellos. Valid Values are Integer + or keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name @@ -298,14 +249,8 @@ def self.title_patterns end # property name newproperty(:role_priority) do - desc 'Priority to be used during vPC role selection of primary vs secondary - Valid values are integers in the range 1 .. 65535' - validate do |value| - if value != 'default' - fail('system_priority should be a value in the range 1 .. 65535') unless - value.to_i.between?(1, 65_535) - end - end + desc "Priority to be used during vPC role selection of primary vs secondary + Valid values are Integer or keyword 'defalult'" munge { |value| value == 'default' ? :default : value.to_i } end # property name @@ -326,13 +271,7 @@ def self.title_patterns end # property name newproperty(:system_priority) do - desc 'VPC system priority. Valid values are integers in the range 1..65535' - validate do |value| - if value != 'default' - fail('system_priority should be a value in the range 1..65535') unless - value.to_i.between?(1, 65_535) - end - end + desc "VPC system priority. Valid values are Integer or keyword 'default'" munge { |value| value == 'default' ? :default : value.to_i } end # property name end # Puppet::Type.newtype diff --git a/metadata.json b/metadata.json index 9e55de5b1..e3be10fc4 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-ciscopuppet", - "version": "1.6.0", + "version": "1.7.0", "author": "cisco", "summary": "Cisco Puppet providers and types for NX-OS devices", "license": "Apache-2.0", @@ -8,7 +8,7 @@ "project_page": "https://github.com/cisco/cisco-network-puppet-module", "issues_url": "https://github.com/cisco/cisco-network-puppet-module/issues", "dependencies": [ - { "name": "puppetlabs/netdev_stdlib", "version_requirement": ">=0.11.1" } + { "name": "puppetlabs/netdev_stdlib", "version_requirement": ">=0.12.0" } ], "requirements": [ { @@ -34,10 +34,13 @@ "7.0(3)I3", "7.0(3)I4", "7.0(3)I5", + "7.0(3)I6", "7.3(0)N1", "7.3(0)D1", "7.0(3)F1", - "8.0(1)" + "7.0(3)F2", + "8.0(1)", + "8.1(1)" ] } ] diff --git a/tests/beaker_tests/cisco_bfd_global/test_bfd_global.rb b/tests/beaker_tests/cisco_bfd_global/test_bfd_global.rb index e9495129b..a4a19ad59 100644 --- a/tests/beaker_tests/cisco_bfd_global/test_bfd_global.rb +++ b/tests/beaker_tests/cisco_bfd_global/test_bfd_global.rb @@ -139,10 +139,13 @@ def unsupported_properties(_tests, _id) unprops << :startup_timer end + unprops +end - # TBD: this is due to nxos bug on n9k-f and n9k - unprops << :interval if platform[/n9k/] - +def version_unsupported_properties(_tests, _id) + unprops = {} + unprops[:interval] = '7.0.3.I6.1' if platform[/n9k$/] + unprops[:interval] = '7.0.3.F2.1' if platform[/n9k-f/] unprops end diff --git a/tests/beaker_tests/cisco_bgp/test_bgp.rb b/tests/beaker_tests/cisco_bgp/test_bgp.rb index 02d778840..9505d6654 100644 --- a/tests/beaker_tests/cisco_bgp/test_bgp.rb +++ b/tests/beaker_tests/cisco_bgp/test_bgp.rb @@ -228,7 +228,7 @@ def unsupported_properties(tests, id) unprops << :event_history_errors << - :event_history_objstore if nexus_image[/I2|I3|I4/] || platform[/n5|n6|n7|n9k-f/] + :event_history_objstore if platform[/n5|n6|n7|n9k-f/] if vrf != 'default' # NX-OS does not support these properties under a non-default vrf @@ -247,7 +247,7 @@ def unsupported_properties(tests, id) :suppress_fib_pending end - if platform[/n(5|6|7)k/] + if platform[/n(5|6)k/] unprops << :disable_policy_batching_ipv4 << :disable_policy_batching_ipv6 << @@ -258,6 +258,20 @@ def unsupported_properties(tests, id) unprops end +def version_unsupported_properties(_tests, _id) + unprops = {} + if platform[/n7k/] + unprops[:disable_policy_batching_ipv4] = '8.1.1' + unprops[:disable_policy_batching_ipv6] = '8.1.1' + unprops[:neighbor_down_fib_accelerate] = '8.1.1' + unprops[:reconnect_interval] = '8.1.1' + elsif platform[/n3k|n9k$/] + unprops[:event_history_errors] = '7.0.3.I5.1' + unprops[:event_history_objstore] = '7.0.3.I5.1' + end + unprops +end + def cleanup(agent) if operating_system == 'nexus' test_set(agent, 'no feature bgp') diff --git a/tests/beaker_tests/cisco_bgp_af/test_bgpaf.rb b/tests/beaker_tests/cisco_bgp_af/test_bgpaf.rb index de67a733a..64c88caf8 100644 --- a/tests/beaker_tests/cisco_bgp_af/test_bgpaf.rb +++ b/tests/beaker_tests/cisco_bgp_af/test_bgpaf.rb @@ -269,6 +269,8 @@ def unsupported_properties(tests, id) vrf == 'default' || platform[/n(3|6)k/] unprops << :additional_paths_install if platform[/n(3|9)k/] + unprops << :additional_paths_selection if platform[/n9k$/] && nexus_image[/I5.3/] + unprops << :additional_paths_selection if platform[/n9k/] && nexus_image[/F2.1/] end unprops end diff --git a/tests/beaker_tests/cisco_bgp_af_aa/test_bgp_af_aa.rb b/tests/beaker_tests/cisco_bgp_af_aa/test_bgp_af_aa.rb new file mode 100644 index 000000000..79a233bf2 --- /dev/null +++ b/tests/beaker_tests/cisco_bgp_af_aa/test_bgp_af_aa.rb @@ -0,0 +1,114 @@ +############################################################################### +# Copyright (c) 2017 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### +# +# See README-develop-beaker-scripts.md (Section: Test Script Variable Reference) +# for information regarding: +# - test script general prequisites +# - command return codes +# - A description of the 'tests' hash and its usage +# +############################################################################### +require File.expand_path('../../lib/utilitylib.rb', __FILE__) + +# Test hash top-level keys +tests = { + master: master, + agent: agent, + operating_system: 'nexus', + resource_name: 'cisco_bgp_af_aa', +} + +skip_unless_supported(tests) + +# Test hash test cases +tests[:default] = { + desc: '1.1 Default Properties', + title_pattern: '2 default ipv4 unicast 1.1.1.1/32', + manifest_props: { + as_set: 'default', + summary_only: 'default', + advertise_map: 'default', + attribute_map: 'default', + suppress_map: 'default', + }, + code: [0, 2], + resource: { + as_set: 'false', + summary_only: 'false', + }, +} + +tests[:non_default1] = { + desc: '2.1 Non Defaults', + title_pattern: '2 red ipv6 multicast 2000::1/128', + manifest_props: { + as_set: 'true', + advertise_map: 'adm', + attribute_map: 'atm', + suppress_map: 'sum', + }, +} + +tests[:non_default2] = { + desc: '2.2 Non Defaults', + title_pattern: '2 red ipv6 multicast 2000::1/128', + manifest_props: { + summary_only: 'true' + }, +} + +def dependency_manifest(_tests, _id) + " + cisco_bgp { '2 default': + ensure => present, + } + + cisco_bgp_af { '2 default ipv4 unicast': + ensure => present, + } + + cisco_bgp_af { '2 red ipv6 multicast': + ensure => present, + } + " +end + +def cleanup(agent) + test_set(agent, 'no feature bgp') +end + +################################################################# +# TEST CASE EXECUTION +################################################################# +test_name "TestCase :: #{tests[:resource_name]}" do + teardown { cleanup(agent) } + cleanup(agent) + + # ------------------------------------------------------------------- + logger.info("\n#{'-' * 60}\nSection 1. Default Property Testing") + test_harness_run(tests, :default) + + # ------------------------------------------------------------------- + logger.info("\n#{'-' * 60}\nSection 2. Non Default Property Testing") + + test_harness_run(tests, :non_default1) + test_harness_run(tests, :non_default2) + + # ------------------------------------------------------------------- + skipped_tests_summary(tests) +end + +logger.info("TestCase :: #{tests[:resource_name]} :: End") diff --git a/tests/beaker_tests/cisco_bgp_neighbor/test_bgpneighbor.rb b/tests/beaker_tests/cisco_bgp_neighbor/test_bgpneighbor.rb index 0421eca60..42e211b81 100644 --- a/tests/beaker_tests/cisco_bgp_neighbor/test_bgpneighbor.rb +++ b/tests/beaker_tests/cisco_bgp_neighbor/test_bgpneighbor.rb @@ -130,12 +130,18 @@ def unsupported_properties(_tests, _id) :remove_private_as else - unprops << :log_neighbor_changes if platform[/n(5|6|7)/] + unprops << :log_neighbor_changes if platform[/n(5|6)/] end unprops end +def version_unsupported_properties(_tests, _id) + unprops = {} + unprops[:log_neighbor_changes] = '8.1.1' if platform[/n7k/] + unprops +end + def cleanup(agent) if operating_system == 'nexus' test_set(agent, 'no feature bgp ; no feature bfd') diff --git a/tests/beaker_tests/cisco_dhcp_relay_global/test_dhcp_relay_global.rb b/tests/beaker_tests/cisco_dhcp_relay_global/test_dhcp_relay_global.rb index 0d6953e1d..0536ce7de 100644 --- a/tests/beaker_tests/cisco_dhcp_relay_global/test_dhcp_relay_global.rb +++ b/tests/beaker_tests/cisco_dhcp_relay_global/test_dhcp_relay_global.rb @@ -140,13 +140,18 @@ def unsupported_properties(_tests, _id) :ipv4_sub_option_circuit_id_string elsif platform[/n9k/] unprops << - :ipv4_src_addr_hsrp << - :ipv4_sub_option_circuit_id_string + :ipv4_src_addr_hsrp end unprops << :ipv4_sub_option_circuit_id_custom if nexus_image['I2'] unprops end +def version_unsupported_properties(_tests, _id) + unprops = {} + unprops[:ipv4_sub_option_circuit_id_string] = '7.0.3.I6.1' if platform[/n9k$/] + unprops +end + def cleanup(agent) test_set(agent, 'no feature dhcp') end diff --git a/tests/beaker_tests/cisco_interface/test_interface_L2.rb b/tests/beaker_tests/cisco_interface/test_interface_L2.rb index 56391d4fe..e15ce64d9 100755 --- a/tests/beaker_tests/cisco_interface/test_interface_L2.rb +++ b/tests/beaker_tests/cisco_interface/test_interface_L2.rb @@ -135,6 +135,14 @@ }, } +tests[:purge] = { + desc: '2.3 Purge Properties', + title_pattern: intf, + manifest_props: { + purge_config: 'true' + }, +} + def unsupported_properties(_tests, _id) unprops = [] unprops << @@ -161,6 +169,10 @@ def unsupported_properties(_tests, _id) logger.info("\n#{'-' * 60}\nSection 1. 'trunk' Property Testing") test_harness_run(tests, :default_trunk) test_harness_run(tests, :non_default_trunk) + + # ------------------------------------------------------------------- + logger.info("\n#{'-' * 60}\nSection 2.3 Purge_config Testing") + test_harness_run(tests, :purge) end logger.info("TestCase :: #{tests[:resource_name]} :: End") diff --git a/tests/beaker_tests/cisco_interface_channel_group/test_interface_channel_group.rb b/tests/beaker_tests/cisco_interface_channel_group/test_interface_channel_group.rb index 45c92e53b..c30874166 100644 --- a/tests/beaker_tests/cisco_interface_channel_group/test_interface_channel_group.rb +++ b/tests/beaker_tests/cisco_interface_channel_group/test_interface_channel_group.rb @@ -37,18 +37,20 @@ title_pattern: intf, code: [0, 2], manifest_props: { - channel_group: 'default', - description: 'default', - shutdown: 'default', + channel_group: 'default', + channel_group_mode: 'default', + description: 'default', + shutdown: 'default', }, resource: { - 'channel_group' => 'false', - 'shutdown' => 'true', + 'channel_group' => 'false', + 'channel_group_mode' => 'false', + 'shutdown' => 'true', }, } -tests[:non_default] = { - desc: '2.1 Non Default Properties commands', +tests[:non_default_no_mode] = { + desc: '2.1 Non Default Properties with no channel group mode', title_pattern: intf, manifest_props: { channel_group: 201, @@ -62,6 +64,23 @@ }, } +tests[:non_default_mode] = { + desc: '2.2 Non Default Properties with channel group mode', + title_pattern: intf, + manifest_props: { + channel_group: 201, + channel_group_mode: 'active', + description: 'chan group desc', + shutdown: 'false', + }, + resource: { + 'channel_group' => '201', + 'channel_group_mode' => 'active', + 'description' => 'chan group desc', + 'shutdown' => 'false', + }, +} + ################################################################# # TEST CASE EXECUTION ################################################################# @@ -75,6 +94,7 @@ # ------------------------------------------------------------------- logger.info("\n#{'-' * 60}\nSection 2. Non Default Property Testing") - test_harness_run(tests, :non_default) + test_harness_run(tests, :non_default_no_mode) + test_harness_run(tests, :non_default_mode) end logger.info("TestCase :: #{tests[:resource_name]} :: End") diff --git a/tests/beaker_tests/cisco_overlay_global/test_overlay_global.rb b/tests/beaker_tests/cisco_overlay_global/test_overlay_global.rb index e1aeb9f4e..fa4e4043c 100755 --- a/tests/beaker_tests/cisco_overlay_global/test_overlay_global.rb +++ b/tests/beaker_tests/cisco_overlay_global/test_overlay_global.rb @@ -26,7 +26,7 @@ tests = { agent: agent, master: master, - platform: 'n(5|6|7|9)k', + platform: 'n(3|5|6|7|9)k', resource_name: 'cisco_overlay_global', ensurable: false, } @@ -73,6 +73,26 @@ }, } +def unsupported_properties(_tests, _id) + unprops = [] + if platform[/n3k/] + unprops << + :anycast_gateway_mac << + :dup_host_ip_addr_detection_host_moves << + :dup_host_ip_addr_detection_timeout + end + unprops +end + +def version_unsupported_properties(_tests, _id) + unprops = {} + if platform[/n3k/] + unprops[:dup_host_mac_detection_host_moves] = '7.0.3.I6.1' + unprops[:dup_host_mac_detection_timeout] = '7.0.3.I6.1' + end + unprops +end + def cleanup(agent) config_find_remove(agent, 'nv overlay evpn', 'incl ^nv') end diff --git a/tests/beaker_tests/cisco_route_map/test_route_map.rb b/tests/beaker_tests/cisco_route_map/test_route_map.rb index 7ff8abdbb..3f454dc25 100644 --- a/tests/beaker_tests/cisco_route_map/test_route_map.rb +++ b/tests/beaker_tests/cisco_route_map/test_route_map.rb @@ -407,7 +407,6 @@ } def unsupp_n3k - im = nexus_image unprops = [] unprops << :match_evpn_route_type_1 << @@ -423,10 +422,6 @@ def unsupp_n3k :match_mac_list << :match_vlan << :set_vrf - unprops << - :match_ospf_area << - :set_ipv4_next_hop_redist << - :set_ipv6_next_hop_redist if im[/(I2|I3|I4)/] unprops end @@ -475,12 +470,6 @@ def unsupp_n9k :set_ipv6_default_next_hop_load_share << :set_extcommunity_rt_asn << :set_vrf - unprops << - :set_ipv4_next_hop_load_share << - :set_ipv6_next_hop_load_share << - :match_ospf_area << - :set_ipv4_next_hop_redist << - :set_ipv6_next_hop_redist if im[/(I2|I3|I4)/] unprops << :match_metric if im['I4'] unprops end @@ -499,12 +488,8 @@ def unsupp_n9kf :match_evpn_route_type_all << :match_length << :match_mac_list << - :match_metric << :match_ospf_area << :match_vlan << - :set_extcommunity_4bytes_additive << - :set_extcommunity_4bytes_non_transitive << - :set_extcommunity_4bytes_transitive << :set_extcommunity_cost_igp << :set_extcommunity_cost_pre_bestpath << :set_extcommunity_rt_additive << @@ -515,11 +500,9 @@ def unsupp_n9kf :set_ipv6_default_next_hop << :set_ipv6_default_next_hop_load_share << :set_ipv4_next_hop << - :set_ipv4_next_hop_load_share << :set_ipv4_precedence << :set_ipv4_prefix << :set_ipv6_next_hop << - :set_ipv6_next_hop_load_share << :set_ipv6_prefix << :set_vrf unprops @@ -539,6 +522,30 @@ def unsupported_properties(_tests, _id) end end +def version_unsupported_properties(_tests, _id) + unprops = {} + if platform[/n9k-f/] + unprops[:match_metric] = '7.0.3.F2.1' + unprops[:set_extcommunity_4bytes_additive] = '7.0.3.F2.1' + unprops[:set_extcommunity_4bytes_non_transitive] = '7.0.3.F2.1' + unprops[:set_extcommunity_4bytes_transitive] = '7.0.3.F2.1' + unprops[:set_ipv4_next_hop_load_share] = '7.0.3.F2.1' + unprops[:set_ipv6_next_hop_load_share] = '7.0.3.F2.1' + elsif platform[/n9k$/] + unprops[:match_ospf_area] = '7.0.3.I5.1' + unprops[:set_ipv4_next_hop_load_share] = '7.0.3.I5.1' + unprops[:set_ipv6_next_hop_load_share] = '7.0.3.I5.1' + unprops[:set_ipv4_next_hop_redist] = '7.0.3.I5.1' + unprops[:set_ipv6_next_hop_redist] = '7.0.3.I5.1' + unprops[:set_community] = '7.0.3.I5.1' + elsif platform[/n3k/] + unprops[:match_ospf_area] = '7.0.3.I5.1' + unprops[:set_ipv4_next_hop_redist] = '7.0.3.I5.1' + unprops[:set_ipv6_next_hop_redist] = '7.0.3.I5.1' + end + unprops +end + def cleanup(agent) resource_absent_cleanup(agent, 'cisco_route_map') end diff --git a/tests/beaker_tests/cisco_stp_global/test_stp_global.rb b/tests/beaker_tests/cisco_stp_global/test_stp_global.rb index aadaa2cfe..7ecefbe97 100644 --- a/tests/beaker_tests/cisco_stp_global/test_stp_global.rb +++ b/tests/beaker_tests/cisco_stp_global/test_stp_global.rb @@ -41,6 +41,8 @@ bpdufilter: 'default', bpduguard: 'default', bridge_assurance: 'default', + domain: 'default', + fcoe: 'default', loopguard: 'default', mode: 'default', pathcost: 'default', @@ -56,6 +58,8 @@ 'bpdufilter' => 'false', 'bpduguard' => 'false', 'bridge_assurance' => 'true', + 'domain' => 'false', + 'fcoe' => 'true', 'loopguard' => 'false', 'mode' => 'rapid-pvst', 'pathcost' => 'short', @@ -117,6 +121,8 @@ bpdufilter: 'true', bpduguard: 'true', bridge_assurance: 'false', + domain: '100', + fcoe: 'true', loopguard: 'true', mode: 'mst', mst_designated_priority: mst_dp, @@ -151,50 +157,6 @@ }, } -tests[:default_plat_1] = { - desc: '1.4 Default Properties platform specific part 1', - platform: 'n9k', - title_pattern: 'default', - manifest_props: { - fcoe: 'default' - }, - code: [0, 2], - resource: { - 'fcoe' => 'true' - }, -} - -tests[:non_default_plat_1] = { - desc: '2.3 Non Default Properties platform specific part 1', - platform: 'n9k', - title_pattern: 'default', - manifest_props: { - fcoe: 'false' - }, -} - -tests[:default_plat_2] = { - desc: '1.4 Default Properties platform specific part 2', - platform: 'n(5|6|7)k', - title_pattern: 'default', - manifest_props: { - domain: 'default' - }, - code: [0, 2], - resource: { - 'domain' => 'false' - }, -} - -tests[:non_default_plat_2] = { - desc: '2.3 Non Default Properties platform specific part 2', - platform: 'n(5|6|7)k', - title_pattern: 'default', - manifest_props: { - domain: '100' - }, -} - tests[:default_bd] = { desc: '1.2 bridge-domain Default Properties platform specific', platform: 'n7k', @@ -258,6 +220,20 @@ def test_harness_dependencies(_tests, id) end end +def unsupported_properties(_tests, _id) + unprops = [] + unprops << :domain if platform[/n9k-f/] + unprops << :fcoe if platform[/n(3|5|6|7)k/] + unprops +end + +def version_unsupported_properties(_tests, _id) + unprops = {} + unprops[:domain] = '7.0.3.I6.1' if platform[/n3k/] + unprops[:domain] = '7.0.3.I6.1' if platform[/n9k$/] + unprops +end + ################################################################# # TEST CASE EXECUTION ################################################################# @@ -270,16 +246,12 @@ def test_harness_dependencies(_tests, id) test_harness_run(tests, :default) test_harness_run(tests, :default_bd) test_harness_run(tests, :default_mst) - test_harness_run(tests, :default_plat_1) - test_harness_run(tests, :default_plat_2) # ------------------------------------------------------------------- logger.info("\n#{'-' * 60}\nSection 2. Non Default Property Testing") test_harness_run(tests, :non_default) test_harness_run(tests, :non_default_bd) - test_harness_run(tests, :non_default_plat_1) - test_harness_run(tests, :non_default_plat_2) # ------------------------------------------------------------------- skipped_tests_summary(tests) diff --git a/tests/beaker_tests/cisco_upgrade/test_upgrade_idempotence.rb b/tests/beaker_tests/cisco_upgrade/test_upgrade_idempotence.rb index f6bb498a7..5a9e45f0b 100644 --- a/tests/beaker_tests/cisco_upgrade/test_upgrade_idempotence.rb +++ b/tests/beaker_tests/cisco_upgrade/test_upgrade_idempotence.rb @@ -22,6 +22,7 @@ # ############################################################################### require File.expand_path('../../lib/utilitylib.rb', __FILE__) +@package = on(agent, facter_cmd('-p cisco.images.system_image')).stdout.chomp @version = image_version.to_s.strip # Test hash top-level keys tests = { @@ -39,13 +40,13 @@ title_pattern: 'image', platform: 'n(3|9)k', manifest_props: { - version: @version, - source_uri: on(agent, facter_cmd('-p cisco.images.system_image')).output, + package: @package, force_upgrade: false, delete_boot_image: false, }, resource: { - version: @version + package: @package, + version: @version, }, } diff --git a/tests/beaker_tests/cisco_vpc_domain/test_vpc_domain.rb b/tests/beaker_tests/cisco_vpc_domain/test_vpc_domain.rb index 9505a04e4..d1fc99874 100644 --- a/tests/beaker_tests/cisco_vpc_domain/test_vpc_domain.rb +++ b/tests/beaker_tests/cisco_vpc_domain/test_vpc_domain.rb @@ -43,8 +43,10 @@ delay_restore: 'default', delay_restore_interface_vlan: 'default', graceful_consistency_check: 'default', + layer3_peer_routing: 'default', peer_gateway: 'default', role_priority: 'default', + shutdown: 'default', system_priority: 'default', }, @@ -53,8 +55,10 @@ 'delay_restore' => '30', 'delay_restore_interface_vlan' => '10', 'graceful_consistency_check' => 'true', + 'layer3_peer_routing' => 'false', 'peer_gateway' => 'false', 'role_priority' => '32667', + 'shutdown' => 'false', 'system_priority' => '32667', }, } @@ -68,6 +72,7 @@ delay_restore_interface_vlan: '300', dual_active_exclude_interface_vlan_bridge_domain: '10-30, 500', graceful_consistency_check: 'true', + layer3_peer_routing: 'true', peer_keepalive_dest: '1.1.1.1', peer_keepalive_hold_timeout: 5, peer_keepalive_interval: 1000, @@ -78,6 +83,7 @@ peer_keepalive_vrf: 'management', peer_gateway: 'true', role_priority: '1024', + shutdown: 'true', system_mac: '00:0c:0d:11:22:33', system_priority: '3000', @@ -89,6 +95,7 @@ 'delay_restore_interface_vlan' => '300', 'dual_active_exclude_interface_vlan_bridge_domain' => '10-30,500', 'graceful_consistency_check' => 'true', + 'layer3_peer_routing' => 'true', 'peer_keepalive_dest' => '1.1.1.1', 'peer_keepalive_hold_timeout' => '5', 'peer_keepalive_interval' => '1000', @@ -99,41 +106,23 @@ 'peer_keepalive_vrf' => 'management', 'peer_gateway' => 'true', 'role_priority' => '1024', + 'shutdown' => 'true', 'system_mac' => '00:0c:0d:11:22:33', 'system_priority' => '3000', }, } -tests[:default_properties_n6k7k] = { - desc: '1.2 Default Properties exclusive to N6K and N7K', - title_pattern: '200', - platform: 'n(6|7)k', - manifest_props: { - layer3_peer_routing: 'default', - shutdown: 'default', - }, - code: [0, 2], - resource: { - 'layer3_peer_routing' => 'false', - 'shutdown' => 'false', - }, -} - tests[:non_default_properties_n6k7k] = { desc: '2.2 Non Default Properties exclusive to N6K and N7K', title_pattern: '200', platform: 'n(6|7)k', manifest_props: { - layer3_peer_routing: 'true', - peer_gateway_exclude_vlan: '500-510, 1100, 1120', - shutdown: 'true', + peer_gateway_exclude_vlan: '500-510, 1100, 1120' }, code: [0, 2], resource: { - 'layer3_peer_routing' => 'true', - 'peer_gateway_exclude_vlan' => '500-510,1100,1120', - 'shutdown' => 'true', + 'peer_gateway_exclude_vlan' => '500-510,1100,1120' }, } @@ -184,6 +173,13 @@ }, } +def version_unsupported_properties(_tests, _id) + unprops = {} + unprops[:layer3_peer_routing] = '7.0.3.I6.1' if platform[/n(3|9)k$/] + unprops[:shutdown] = '7.0.3.I6.1' if platform[/n(3|9)k$/] + unprops +end + def cleanup(agent) remove_all_vlans(agent) resource_absent_cleanup(agent, 'cisco_vpc_domain') @@ -203,7 +199,6 @@ def cleanup(agent) logger.info("\n#{'-' * 60}\nSection 1. Default Property Testing") test_harness_run(tests, :default_properties) - test_harness_run(tests, :default_properties_n6k7k) test_harness_run(tests, :default_properties_n7k) # Resource absent test diff --git a/tests/beaker_tests/cisco_vxlan_vtep/test_vxlan_vtep.rb b/tests/beaker_tests/cisco_vxlan_vtep/test_vxlan_vtep.rb index 2f24ba57e..6e5ae5a08 100644 --- a/tests/beaker_tests/cisco_vxlan_vtep/test_vxlan_vtep.rb +++ b/tests/beaker_tests/cisco_vxlan_vtep/test_vxlan_vtep.rb @@ -64,7 +64,13 @@ def unsupported_properties(*) unprops = [] - unprops << :source_interface_hold_down_time unless platform[/n(9)k/] + unprops << :source_interface_hold_down_time if platform[/n(5|6)k/] + unprops +end + +def version_unsupported_properties(_tests, _id) + unprops = {} + unprops[:source_interface_hold_down_time] = '8.1.1' if platform[/n7k/] unprops end diff --git a/tests/beaker_tests/cisco_vxlan_vtep_vni/test_vxlan_vtep_vni.rb b/tests/beaker_tests/cisco_vxlan_vtep_vni/test_vxlan_vtep_vni.rb index 330667432..47912301c 100644 --- a/tests/beaker_tests/cisco_vxlan_vtep_vni/test_vxlan_vtep_vni.rb +++ b/tests/beaker_tests/cisco_vxlan_vtep_vni/test_vxlan_vtep_vni.rb @@ -55,20 +55,7 @@ require File.expand_path('../../lib/utilitylib.rb', __FILE__) -# ----------------------------- -# Common settings and variables -# ----------------------------- -testheader = 'Resource cisco_vxlan_vtep_vni' - -# The 'tests' hash is used to define all of the test data values and expected -# results. It is also used to pass optional flags to the test methods when -# necessary. - -# 'tests' hash -# Top-level keys set by caller: -# tests[:master] - the master object -# tests[:agent] - the agent object -# +# Test hash top-level keys tests = { master: master, agent: agent, @@ -79,261 +66,206 @@ # Skip -ALL- tests if a top-level platform/os key exludes this platform skip_unless_supported(tests) -# tests[id] keys set by caller and used by test_harness_common: -# -# tests[id] keys set by caller: -# tests[id][:desc] - a string to use with logs & debugs -# tests[id][:manifest] - the complete manifest, as used by test_harness_common -# tests[id][:resource] - a hash of expected states, used by test_resource -# tests[id][:resource_cmd] - 'puppet resource' command to use with test_resource -# tests[id][:ensure] - (Optional) set to :present or :absent before calling -# tests[id][:code] - (Optional) override the default exit code in some tests. -# -# These keys are local use only and not used by test_harness_common: -# -# tests[id][:manifest_props] - This is essentially a master list of properties -# that permits re-use of the properties for both :present and :absent testing -# without destroying the list -# tests[id][:resource_props] - This is essentially a master hash of properties -# that permits re-use of the properties for both :present and :absent testing -# without destroying the hash -# tests[id][:title_pattern] - (Optional) defines the manifest title. -# Can be used with :af for mixed title/af testing. If mixing, :af values will -# be merged with title values and override any duplicates. If omitted, -# :title_pattern will be set to 'id'. -# tests[id][:af] - (Optional) defines the address-family values. -# Must use :title_pattern if :af is not specified. Useful for testing mixed -# title/af manifests -# -tests['default_properties_ingress_replication'] = { +# Test hash test cases +tests[:default_properties_ingress_replication] = { + desc: '1.1 Default Properties Ingress replication', title_pattern: 'nve1 10000', - platform: 'n9k', - manifest_props: " - ingress_replication => 'default', - suppress_arp => 'default', - ", - resource_props: { - # 'ingress_replication' not set. - 'suppress_arp' => 'false' + platform: 'n(7|9)k', + manifest_props: { + ingress_replication: 'default', + suppress_arp: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false' }, } -tests['default_properties_multicast_group'] = { +tests[:default_properties_multicast_group] = { + desc: '1.2 Default Properties Multicast Group', title_pattern: 'nve1 10000', - manifest_props: " - multicast_group => 'default', - suppress_arp => 'default', - ", - resource_props: { - # 'multicast_group' not set. - 'suppress_arp' => 'false' + manifest_props: { + multicast_group: 'default', + suppress_arp: 'default', + suppress_uuc: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false', + suppress_uuc: 'false', }, } -# Suppress Unknown Unicast -if platform[/n(5|6)k/] - tests['default_properties_multicast_group'][:manifest_props] += - " suppress_uuc => 'default'," - tests['default_properties_multicast_group'][:resource_props]['suppress_uuc'] = 'false' -end - -tests['ingress_replication_static_peer_list_empty'] = { +tests[:ingress_replication_static_peer_list_empty] = { + desc: '2.1 Ingress Replication Static Peer List Empty', title_pattern: 'nve1 10000', - platform: 'n9k', - manifest_props: " - ingress_replication => 'static', - peer_list => [], - suppress_arp => 'default' - ", - resource_props: { - 'ingress_replication' => 'static', - # 'peer_list' not set. - 'suppress_arp' => 'false', + platform: 'n(7|9)k', + manifest_props: { + ingress_replication: 'static', + peer_list: [], + suppress_arp: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false' }, } -tests['peer_list'] = { +tests[:peer_list] = { + desc: '2.2 Peer List', title_pattern: 'nve1 10000', - platform: 'n9k', - manifest_props: " - ingress_replication => 'static', - peer_list => ['1.1.1.1', '2.2.2.2', '3.3.3.3'], - suppress_arp => 'default' - ", - resource_props: { - 'ingress_replication' => 'static', - 'peer_list' => "['1.1.1.1', '2.2.2.2', '3.3.3.3']", - 'suppress_arp' => 'false', + platform: 'n(7|9)k', + manifest_props: { + ingress_replication: 'static', + peer_list: ['1.1.1.1', '2.2.2.2', '3.3.3.3'], + suppress_arp: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false' }, } -tests['peer_list_change_add'] = { +tests[:peer_list_change_add] = { + desc: '2.3 Peer List Change Add', title_pattern: 'nve1 10000', - platform: 'n9k', - manifest_props: " - ingress_replication => 'static', - peer_list => ['1.1.1.1', '6.6.6.6', '3.3.3.3', '4.4.4.4'], - suppress_arp => 'default' - ", - resource_props: { - 'ingress_replication' => 'static', - 'peer_list' => "['1.1.1.1', '3.3.3.3', '4.4.4.4', '6.6.6.6']", - 'suppress_arp' => 'false', + platform: 'n(7|9)k', + manifest_props: { + ingress_replication: 'static', + peer_list: ['1.1.1.1', '6.6.6.6', '3.3.3.3', '4.4.4.4'], + suppress_arp: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false' }, } -tests['peer_list_default'] = { +tests[:peer_list_default] = { + desc: '2.4 Peer List Default', title_pattern: 'nve1 10000', - platform: 'n9k', - manifest_props: " - ingress_replication => 'static', - peer_list => 'default', - suppress_arp => 'default' - ", - resource_props: { - 'ingress_replication' => 'static', - # 'peer_list' not set. - 'suppress_arp' => 'false', + platform: 'n(7|9)k', + manifest_props: { + ingress_replication: 'static', + peer_list: 'default', + suppress_arp: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false' }, } -tests['ingress_replication_bgp'] = { +tests[:ingress_replication_bgp] = { + desc: '2.5 Ingress replication BGP', title_pattern: 'nve1 10000', - platform: 'n9k', - manifest_props: " - ingress_replication => 'bgp', - suppress_arp => 'default' - ", - resource_props: { - 'ingress_replication' => 'bgp', - 'suppress_arp' => 'false', + platform: 'n(7|9)k', + manifest_props: { + ingress_replication: 'bgp', + suppress_arp: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false' }, } -tests['multicast_group'] = { +tests[:multicast_group] = { + desc: '2.6 Multicast Group', title_pattern: 'nve1 10000', - manifest_props: " - multicast_group => '224.1.1.1', - suppress_arp => 'default' - ", - resource_props: { - 'multicast_group' => '224.1.1.1', - 'suppress_arp' => 'false', + manifest_props: { + multicast_group: '224.1.1.1', + suppress_arp: 'default', + }, + code: [0, 2], + resource: { + suppress_arp: 'false' }, } -tests['suppress_arp_true'] = { +tests[:suppress_arp_true] = { + desc: '2.7 Suppress ARP True', title_pattern: 'nve1 10000', - manifest_props: " - suppress_arp => 'true' - ", - resource_props: { - 'suppress_arp' => 'true' + manifest_props: { + suppress_arp: 'true' }, + code: [0, 2], } -tests['suppress_arp_false'] = { +tests[:suppress_arp_false] = { + desc: '2.8 Suppress ARP False', title_pattern: 'nve1 10000', - manifest_props: " - suppress_arp => 'false' - ", - resource_props: { - 'suppress_arp' => 'false' + manifest_props: { + suppress_arp: 'false' }, + code: [0, 2], } -tests['suppress_uuc_true'] = { +tests[:suppress_uuc_true] = { + desc: '2.9 Suppress UUC True', title_pattern: 'nve1 10000', - platform: 'n(5|6)k', - manifest_props: " - suppress_uuc => 'true' - ", - resource_props: { - 'suppress_uuc' => 'true' + manifest_props: { + suppress_uuc: 'true' }, + code: [0, 2], } -tests['suppress_uuc_false'] = { +tests[:suppress_uuc_false] = { + desc: '2.10 Suppress UUC False', title_pattern: 'nve1 10000', - platform: 'n(5|6)k', - manifest_props: " - suppress_uuc => 'false' - ", - resource_props: { - 'suppress_uuc' => 'false' + manifest_props: { + suppress_uuc: 'false' }, + code: [0, 2], } # Note: In the current implementation assciate-vrf is a namevar. # It will be changed to a property in future. A correspoding test # will be added here. -################################################################# -# HELPER FUNCTIONS -################################################################# - -# Full command string for puppet resource command -def puppet_resource_cmd - PUPPET_BINPATH + 'resource cisco_vxlan_vtep_vni' -end - def test_harness_dependencies(*) return unless platform[/n(5|6)k/] skip_if_nv_overlay_rejected(agent) end -def build_manifest_cisco_vxlan_vtep_vni(tests, id) - if tests[id][:ensure] == :absent - state = 'ensure => absent,' - tests[id][:resource] = {} - else - state = 'ensure => present,' - manifest = tests[id][:manifest_props] - tests[id][:resource] = tests[id][:resource_props] - end - - tests[id][:title_pattern] = id if tests[id][:title_pattern].nil? - logger.debug("build_manifest_cisco_vxlan_vtep_vni :: title_pattern:\n" + - tests[id][:title_pattern]) - - # cisco_vxlan_vtep_vni needs cisco_vxlan_vtep as a prerequisite. - tests[id][:manifest] = "cat <<EOF >#{PUPPETMASTER_MANIFESTPATH} - node 'default' { +# Overridden to properly handle dependencies for this test file. +def dependency_manifest(_tests, _id) + " cisco_vxlan_vtep {'nve1': ensure => present, host_reachability => 'evpn', shutdown => 'false', } - cisco_vxlan_vtep_vni { '#{tests[id][:title_pattern]}': - #{state} - #{manifest} - } - } -EOF" + " end -def test_harness_cisco_vxlan_vtep_vni(tests, id) - return unless platform_supports_test(tests, id) - - test_harness_dependencies(tests, id) - - tests[id][:ensure] = :present if tests[id][:ensure].nil? - tests[id][:resource_cmd] = puppet_resource_cmd - tests[id][:desc] += " [ensure => #{tests[id][:ensure]}]" - - build_manifest_cisco_vxlan_vtep_vni(tests, id) - - test_manifest(tests, id) - test_resource(tests, id) - test_idempotence(tests, id) +def unsupported_properties(_tests, _id) + unprops = [] + if platform[/n(5|6)k/] + unprops << + :ingress_replication << + :peer_list + elsif platform[/n9k/] + unprops << + :suppress_uuc + end + unprops +end - tests[id][:ensure] = nil +def version_unsupported_properties(_tests, _id) + unprops = {} + if platform[/n7k/] + unprops[:ingress_replication] = '8.1.1' + unprops[:peer_list] = '8.1.1' + unprops[:suppress_uuc] = '8.1.1' + end + unprops end ################################################################# # TEST CASE EXECUTION ################################################################# -test_name "TestCase :: #{testheader}" do +test_name "TestCase :: #{tests[:resource_name]}" do teardown do resource_absent_cleanup(agent, 'cisco_vxlan_vtep_vni') vdc_limit_f3_no_intf_needed(:clear) @@ -343,69 +275,38 @@ def test_harness_cisco_vxlan_vtep_vni(tests, id) # ------------------------------------------------------------------- logger.info("\n#{'-' * 60}\nSection 1. Default Property Testing") - id = 'default_properties_ingress_replication' - tests[id][:desc] = '1.1 Default Properties Ingress Replication' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - tests[id][:desc] = '1.2 Default Properties Ingress Replication' + id = :default_properties_ingress_replication + test_harness_run(tests, id) tests[id][:ensure] = :absent - test_harness_cisco_vxlan_vtep_vni(tests, id) - - id = 'default_properties_multicast_group' - tests[id][:desc] = '1.3 Default Properties Multicast Group' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - tests[id][:desc] = '1.4 Default Properties Multicast Group' + test_harness_run(tests, id) + id = :default_properties_multicast_group + test_harness_run(tests, id) tests[id][:ensure] = :absent - test_harness_cisco_vxlan_vtep_vni(tests, id) + test_harness_run(tests, id) # ------------------------------------------------------------------- logger.info("\n#{'-' * 60}\nSection 2. Non Default Property Testing") - id = 'ingress_replication_static_peer_list_empty' - tests[id][:desc] = '2.1 Ingress Replication Static' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - id = 'peer_list' - tests[id][:desc] = '2.2 Peer List' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - id = 'peer_list_change_add' - tests[id][:desc] = '2.3 Peer List Change Add' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - id = 'peer_list_default' - tests[id][:desc] = '2.4 Peer List Default' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - id = 'ingress_replication_bgp' - tests[id][:desc] = '2.5 Ingress Replication BGP' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - id = 'multicast_group' - tests[id][:desc] = '2.6 Multicast Group' - test_harness_cisco_vxlan_vtep_vni(tests, id) + test_harness_run(tests, :ingress_replication_static_peer_list_empty) + test_harness_run(tests, :peer_list) + test_harness_run(tests, :peer_list_change_add) + test_harness_run(tests, :peer_list_default) + test_harness_run(tests, :ingress_replication_bgp) + test_harness_run(tests, :multicast_group) # TBD - The suppress_arp tests will generate the following error. # ERROR: Please configure TCAM region... Configuring the TCAM region # requires a switch reboot. These tests will remain commented out # until we can design a solution. - # id = 'suppress_arp_true' - # tests[id][:desc] = '2.7 Suppress ARP' - # test_harness_cisco_vxlan_vtep_vni(tests, id) + # test_harness_run(tests, :suppress_arp_true) + # test_harness_run(tests, :suppress_arp_false) - # id = 'suppress_arp_false' - # tests[id][:desc] = '2.8 Suppress ARP' - # test_harness_cisco_vxlan_vtep_vni(tests, id) + test_harness_run(tests, :suppress_uuc_true) + test_harness_run(tests, :suppress_uuc_false) - id = 'suppress_uuc_true' - tests[id][:desc] = '2.9 Suppress Unknown Unicast' - test_harness_cisco_vxlan_vtep_vni(tests, id) - - id = 'suppress_uuc_false' - tests[id][:desc] = '2.10 Suppress Unknown Unicast' - test_harness_cisco_vxlan_vtep_vni(tests, id) + # ------------------------------------------------------------------- + skipped_tests_summary(tests) end -logger.info('TestCase :: # {testheader} :: End') +logger.info("TestCase :: #{tests[:resource_name]} :: End") diff --git a/tests/beaker_tests/file_service_package/test_package_patch.rb b/tests/beaker_tests/file_service_package/test_package_patch.rb index 37ee70904..c9688a2cd 100755 --- a/tests/beaker_tests/file_service_package/test_package_patch.rb +++ b/tests/beaker_tests/file_service_package/test_package_patch.rb @@ -34,6 +34,9 @@ when /7.0.3.I2.2e/ filename = 'nxos.sample-n9k_EOR-1.0.0-7.0.3.I2.2e.lib32_n9000.rpm' version = '1.0.0-7.0.3.I2.2e' +when /7.0.3.I2.5/ + filename = 'nxos.sample-n9k_EOR-1.0.0-7.0.3.I2.5.lib32_n9000.rpm' + version = '1.0.0-7.0.3.I2.5' when /7.0.3.I3.1/ filename = 'nxos.sample-n9k_EOR-1.0.0-7.0.3.I3.1.lib32_n9000.rpm' version = '1.0.0-7.0.3.I3.1' @@ -43,10 +46,28 @@ when /7.0.3.I4.2/ filename = 'nxos.sample-n9k_EOR-1.0.0-7.0.3.I4.2.lib32_n9000.rpm' version = '1.0.0-7.0.3.I4.2' -when /7.0.3.I5/ +when /7.0.3.I4.5/ + filename = 'nxos.sample-n9k_EOR-1.0.0-7.0.3.I4.5.lib32_n9000.rpm' + version = '1.0.0-7.0.3.I4.5' +when /7.0.3.I4.6/ + filename = 'nxos.sample-n9k_EOR-1.0.0-7.0.3.I4.6.lib32_n9000.rpm' + version = '1.0.0-7.0.3.I4.6' +when /7.0.3.I5.1/ name = 'nxos.sample-n9k_ALL' filename = 'nxos.sample-n9k_ALL-1.0.0-7.0.3.I5.1.lib32_n9000.rpm' version = '1.0.0-7.0.3.I5.1' +when /7.0.3.I5.2/ + name = 'nxos.sample-n9k_ALL' + filename = 'nxos.sample-n9k_ALL-1.0.0-7.0.3.I5.2.lib32_n9000.rpm' + version = '1.0.0-7.0.3.I5.2' +when /7.0.3.I5.3/ + name = 'nxos.sample-n9k_ALL' + filename = 'nxos.sample-n9k_ALL-1.0.0-7.0.3.I5.3.lib32_n9000.rpm' + version = '1.0.0-7.0.3.I5.3' +when /7.0.3.I6.1/ + name = 'nxos.sample-n9k_ALL' + filename = 'nxos.sample-n9k_ALL-1.0.0-7.0.3.I6.1.lib32_n9000.rpm' + version = '1.0.0-7.0.3.I6.1' when /7.0.3.F1/ name = 'nxos.sample-n8k_EOR' filename = 'nxos.sample-n8k_EOR-1.0.0-7.0.3.F1.1.lib32_nxos.rpm' @@ -68,6 +89,7 @@ # Skip -ALL- tests if a top-level platform/os key exludes this platform skip_unless_supported(tests) +skip_nexus_image(%w(I2 I3), tests) tests[:yum_patch_install] = { desc: "1.1 Apply sample patch #{name} to image #{image?}", diff --git a/tests/beaker_tests/lib/utilitylib.rb b/tests/beaker_tests/lib/utilitylib.rb index 74fc7e3e2..49e25a0f2 100644 --- a/tests/beaker_tests/lib/utilitylib.rb +++ b/tests/beaker_tests/lib/utilitylib.rb @@ -685,6 +685,21 @@ def unsupported_properties(_tests, _id) [] # defaults to no unsupported properties end +# version_unsupported_properties +# +# Returns an array of properties that are not supported for +# a particular operating_system or platform for a particular +# software version. +# Override this in a particular test file as needed. +# Ex: If property 'ipv4_sub_option_circuit_id_string' is +# supported on n9k only on version '7.0.3.I6.1' or higher +# then add this line in the overridden method. +# unprops[:ipv4_sub_option_circuit_id_string] = '7.0.3.I6.1' if +# platform[/n9k$/] +def version_unsupported_properties(_tests, _id) + {} # defaults to no version_unsupported properties +end + # supported_property_hash # # This method creates a clone of the specified property @@ -699,6 +714,25 @@ def supported_property_hash(tests, id, property_hash) # because :resource hash currently uses strings for keys copy.delete(prop_symbol.to_s) end + return copy if version_unsupported_properties(tests, id).empty? + lim = full_version.split[0].tr('(', '.').tr(')', '.').chomp('.') + # due to a bug in Gem::Version, we need to append a letter + # to the version field if the to be compared version + # has a letter at the end + # For ex: + # 7.0.3.I2.2e < 7.0.3.I2.2 is TRUE instead of FALSE + # Once we add a letter 'a' to the end, + # 7.0.3.I2.2e < 7.0.3.I2.2a is FALSE + append_a = false + append_a = true if lim[-1, 1] =~ /[[:alpha:]]/ + version_unsupported_properties(tests, id).each do |key, val| + val << 'a' if append_a + append_a = false + next unless Gem::Version.new(lim) < Gem::Version.new(val) + copy.delete(key) + # because :resource hash currently uses strings for keys + copy.delete(key.to_s) + end copy end @@ -1119,10 +1153,18 @@ def image_version @version ||= data end +# Gets the full version of the image running on a device +@full_ver = nil +def full_version + facter_opt = '-p cisco.images.full_version' + data = on(agent, facter_cmd(facter_opt)).stdout.chomp + @full_ver ||= data +end + # On match will skip all testcases # Do not use this for skipping individual properties. def skip_nexus_image(image, tests) - return unless nexus_image[image] + return unless nexus_image.match(Regexp.union(image)) msg = "Skipping all tests; '#{tests[:resource_name]}' "\ "is not supported on #{image} images" banner = '#' * msg.length diff --git a/tests/beaker_tests/ntp_auth_key/ntp_auth_key_provider_defaults.rb b/tests/beaker_tests/ntp_auth_key/ntp_auth_key_provider_defaults.rb new file mode 100644 index 000000000..31a690c8e --- /dev/null +++ b/tests/beaker_tests/ntp_auth_key/ntp_auth_key_provider_defaults.rb @@ -0,0 +1,131 @@ +############################################################################### +# Copyright (c) 2014-2017 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### +# TestCase Name: +# ------------- +# NtpAuthKey-Provider-Defaults.rb +# +# TestCase Prerequisites: +# ----------------------- +# This is a ntp_auth_key resource testcase for Puppet Agent on Nexus devices. +# The test case assumes the following prerequisites are already satisfied: +# A. Populating the HOSTS configuration file with the agent and master +# information. +# B. Enabling SSH connection prerequisites on the N9K switch based Agent. +# C. Starting of Puppet master server on master. +# D. Sending to and signing of Puppet agent certificate request on master. +# +# TestCase: +# --------- +# This is a ntp_auth_key resource test that tests for default value for +# 'ensure' attribute of a ntp_auth_key resource. +# +# There are 2 sections to the testcase: Setup, group of teststeps. +# The 1st step is the Setup teststep that cleans up the switch state. +# Steps 2-4 deal with ntp_auth_key resource and its +# verification using Puppet Agent and the switch running-config. +# +# The testcode checks for exit_codes from Puppet Agent, Vegas shell and +# Bash shell command executions. For Vegas shell and Bash shell command +# string executions, this is the exit_code convention: +# 0 - successful command execution, > 0 - failed command execution. +# For Puppet Agent command string executions, this is the exit_code convention: +# 0 - no changes have occurred, 1 - errors have occurred, +# 2 - changes have occurred, 4 - failures have occurred and +# 6 - changes and failures have occurred. +# 0 is the default exit_code checked in Beaker::DSL::Helpers::on() method. +# The testcode also uses RegExp pattern matching on stdout or output IO +# instance attributes of Result object from on() method invocation. +# +############################################################################### + +# Require UtilityLib.rb and NtpAuthKeyLib.rb paths. +require File.expand_path('../../lib/utilitylib.rb', __FILE__) +require File.expand_path('../ntp_auth_keylib.rb', __FILE__) + +result = 'PASS' +testheader = 'ntp_auth_key Resource :: All Attributes Defaults' + +# @test_name [TestCase] Executes defaults testcase for ntp_auth_key Resource. +test_name "TestCase :: #{testheader}" do + # @step [Step] Sets up switch for provider test. + step 'TestStep :: Setup switch for provider test' do + # Cleanup before starting test. + resource_absent_cleanup(agent, 'ntp_auth_key') + # Cleanup after running test. + teardown { resource_absent_cleanup(agent, 'ntp_auth_key') } + end + + # @step [Step] Requests manifest from the master server to the agent. + step 'TestStep :: Get resource present manifest from master' do + # Expected exit_code is 0 since this is a bash shell cmd. + on(master, NtpAuthKeyLib.create_ntp_auth_key_manifest_present) + + # Expected exit_code is 2 since this is a puppet agent cmd with change. + cmd_str = PUPPET_BINPATH + 'agent -t' + on(agent, cmd_str, acceptable_exit_codes: [2]) + + logger.info("Get resource present manifest from master :: #{result}") + end + + # @step [Step] Checks ntp_auth_key resource on agent using resource cmd. + step 'TestStep :: Check ntp_auth_key resource presence on agent' do + # Expected exit_code is 0 since this is a puppet resource cmd. + # Flag is set to false to check for presence of RegExp pattern in stdout. + cmd_str = PUPPET_BINPATH + 'resource ntp_auth_key 1' + on(agent, cmd_str) do + search_pattern_in_output(stdout, { 'ensure' => 'present' }, + false, self, logger) + search_pattern_in_output(stdout, { 'algorithm' => 'md5' }, + false, self, logger) + search_pattern_in_output(stdout, { 'mode' => '7' }, + false, self, logger) + search_pattern_in_output(stdout, { 'password' => 'test' }, + false, self, logger) + end + + logger.info("Check ntp_auth_key resource presence on agent :: #{result}") + end + + # @step [Step] Requests manifest from the master server to the agent. + step 'TestStep :: Get resource absent manifest from master' do + # Expected exit_code is 0 since this is a bash shell cmd. + on(master, NtpAuthKeyLib.create_ntp_auth_key_manifest_absent) + + # Expected exit_code is 2 since this is a puppet agent cmd with change. + cmd_str = PUPPET_BINPATH + 'agent -t' + on(agent, cmd_str, acceptable_exit_codes: [2]) + + logger.info("Get resource absent manifest from master :: #{result}") + end + + # @step [Step] Checks ntp_auth_key resource on agent using resource cmd. + step 'TestStep :: Check ntp_auth_key resource absence on agent' do + # Expected exit_code is 0 since this is a puppet resource cmd. + # Flag is set to true to check for absence of RegExp pattern in stdout. + cmd_str = PUPPET_BINPATH + 'resource ntp_auth_key 1' + on(agent, cmd_str) do + search_pattern_in_output(stdout, { 'ensure' => 'present' }, + true, self, logger) + end + + logger.info("Check ntp_auth_key resource absence on agent :: #{result}") + end + + # @raise [PassTest/FailTest] Raises PassTest/FailTest exception using result. + raise_passfail_exception(result, testheader, self, logger) +end + +logger.info("TestCase :: #{testheader} :: End") diff --git a/tests/beaker_tests/ntp_auth_key/ntp_auth_keylib.rb b/tests/beaker_tests/ntp_auth_key/ntp_auth_keylib.rb new file mode 100644 index 000000000..a919ac964 --- /dev/null +++ b/tests/beaker_tests/ntp_auth_key/ntp_auth_keylib.rb @@ -0,0 +1,70 @@ +############################################################################### +# Copyright (c) 2014-2017 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### +# NTP Server Utility Library: +# --------------------- +# ntp_auth_keylib.rb +# +# This is the utility library for the ntp server provider Beaker test cases +# that contains the common methods used across the ntp server testsuite's +# cases. The library is implemented as a module with related methods and +# constants defined inside it for use as a namespace. All of the methods are +# defined as module methods. +# +# Every Beaker ntp server test case that runs an instance of Beaker::TestCase +# requires NtpAuthKeyLib module. +# +# The module has a single set of methods: +# A. Methods to create manifests for ntp_auth_key Puppet provider test cases. +############################################################################### + +# Require UtilityLib.rb path. +require File.expand_path('../../lib/utilitylib.rb', __FILE__) + +# A library to assist testing ntp_auth_key resource +module NtpAuthKeyLib + # A. Methods to create manifests for ntp_auth_key Puppet provider test cases. + + # Method to create a manifest for ntp_auth_key resource attribute 'ensure' + # where 'ensure' is set to present. + # @param none [None] No input parameters exist. + # @result none [None] Returns no object. + def self.create_ntp_auth_key_manifest_present + manifest_str = "cat <<EOF >#{PUPPETMASTER_MANIFESTPATH} +node default { + ntp_auth_key { '1': + ensure => 'present', + password => 'test', + } +} +EOF" + manifest_str + end + + # Method to create a manifest for ntp_auth_key resource attribute 'ensure' + # where 'ensure' is set to absent. + # @param none [None] No input parameters exist. + # @result none [None] Returns no object. + def self.create_ntp_auth_key_manifest_absent + manifest_str = "cat <<EOF >#{PUPPETMASTER_MANIFESTPATH} +node default { + ntp_auth_key {'1': + ensure => absent, + } +} +EOF" + manifest_str + end +end diff --git a/tests/beaker_tests/ntp_config/ntp_configlib.rb b/tests/beaker_tests/ntp_config/ntp_configlib.rb index 87292416b..46dda8226 100644 --- a/tests/beaker_tests/ntp_config/ntp_configlib.rb +++ b/tests/beaker_tests/ntp_config/ntp_configlib.rb @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2014-2015 Cisco and/or its affiliates. +# Copyright (c) 2014-2017 Cisco and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,20 +35,25 @@ # A library to assist testing ntp_config resource module NtpConfigLib - # Group of Constants used in negative tests for ntp_config provider. - ENSURE_NEGATIVE = 'unknown' - # A. Methods to create manifests for ntp_config Puppet provider test cases. # Method to create a manifest for ntp_config resource attribute 'ensure' # where 'ensure' is set to present. - # @param none [None] No input parameters exist. + # @param intf [String] source_interface # @result none [None] Returns no object. def self.create_ntp_config_manifest_set(intf) manifest_str = "cat <<EOF >#{PUPPETMASTER_MANIFESTPATH} node default { + ntp_auth_key { '1': + ensure => 'present', + algorithm => 'md5', + mode => '7', + password => 'test', + } ntp_config {'default': + authenticate => 'true', source_interface => '#{intf}', + trusted_key => '1', } } EOF" @@ -62,8 +67,13 @@ def self.create_ntp_config_manifest_set(intf) def self.create_ntp_config_manifest_unset manifest_str = "cat <<EOF >#{PUPPETMASTER_MANIFESTPATH} node default { + ntp_auth_key { '1': + ensure => 'absent', + } ntp_config {'default': + authenticate => 'false', source_interface => 'unset', + trusted_key => 'unset', } } EOF" diff --git a/tests/beaker_tests/ntp_server/ntp_server_provider_defaults.rb b/tests/beaker_tests/ntp_server/ntp_server_provider_defaults.rb index 6ffca7972..7e98c0900 100644 --- a/tests/beaker_tests/ntp_server/ntp_server_provider_defaults.rb +++ b/tests/beaker_tests/ntp_server/ntp_server_provider_defaults.rb @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2014-2015 Cisco and/or its affiliates. +# Copyright (c) 2014-2017 Cisco and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -64,6 +64,8 @@ step 'TestStep :: Setup switch for provider test' do # Cleanup before starting test. resource_absent_cleanup(agent, 'ntp_server') + # Cleanup after running test. + teardown { resource_absent_cleanup(agent, 'ntp_server') } end # @step [Step] Requests manifest from the master server to the agent. @@ -88,32 +90,7 @@ false, self, logger) search_pattern_in_output(stdout, { 'prefer' => 'false' }, false, self, logger) - end - - logger.info("Check ntp_server resource presence on agent :: #{result}") - end - - # @step [Step] Requests manifest from the master server to the agent. - step 'TestStep :: Get resource present and prefer true manifest from master' do - # Expected exit_code is 0 since this is a bash shell cmd. - on(master, NtpServerLib.create_ntp_server_manifest_present_prefer) - - # Expected exit_code is 2 since this is a puppet agent cmd with change. - cmd_str = PUPPET_BINPATH + 'agent -t' - on(agent, cmd_str, acceptable_exit_codes: [2]) - - logger.info("Get resource present and prefer true manifest from master :: #{result}") - end - - # @step [Step] Checks ntp_server resource on agent using resource cmd. - step 'TestStep :: Check ntp_server resource presence with prefer true on agent' do - # Expected exit_code is 0 since this is a puppet resource cmd. - # Flag is set to false to check for presence of RegExp pattern in stdout. - cmd_str = PUPPET_BINPATH + 'resource ntp_server 5.5.5.5' - on(agent, cmd_str) do - search_pattern_in_output(stdout, { 'ensure' => 'present' }, - false, self, logger) - search_pattern_in_output(stdout, { 'prefer' => 'true' }, + search_pattern_in_output(stdout, { 'vrf' => 'default' }, false, self, logger) end diff --git a/tests/beaker_tests/ntp_server/ntp_server_provider_nondefaults.rb b/tests/beaker_tests/ntp_server/ntp_server_provider_nondefaults.rb new file mode 100644 index 000000000..148ab032d --- /dev/null +++ b/tests/beaker_tests/ntp_server/ntp_server_provider_nondefaults.rb @@ -0,0 +1,151 @@ +############################################################################### +# Copyright (c) 2014-2017 Cisco and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### +# TestCase Name: +# ------------- +# NtpServer-Provider-NonDefaults.rb +# +# TestCase Prerequisites: +# ----------------------- +# This is a ntp_server resource testcase for Puppet Agent on Nexus devices. +# The test case assumes the following prerequisites are already satisfied: +# A. Populating the HOSTS configuration file with the agent and master +# information. +# B. Enabling SSH connection prerequisites on the N9K switch based Agent. +# C. Starting of Puppet master server on master. +# D. Sending to and signing of Puppet agent certificate request on master. +# +# TestCase: +# --------- +# This is a ntp_server resource test that tests for nondefault value for +# 'ensure' attribute of a ntp_server resource. +# +# There are 2 sections to the testcase: Setup, group of teststeps. +# The 1st step is the Setup teststep that cleans up the switch state. +# Steps 2-4 deal with ntp_server resource and its +# verification using Puppet Agent and the switch running-config. +# +# The testcode checks for exit_codes from Puppet Agent, Vegas shell and +# Bash shell command executions. For Vegas shell and Bash shell command +# string executions, this is the exit_code convention: +# 0 - successful command execution, > 0 - failed command execution. +# For Puppet Agent command string executions, this is the exit_code convention: +# 0 - no changes have occurred, 1 - errors have occurred, +# 2 - changes have occurred, 4 - failures have occurred and +# 6 - changes and failures have occurred. +# 0 is the default exit_code checked in Beaker::DSL::Helpers::on() method. +# The testcode also uses RegExp pattern matching on stdout or output IO +# instance attributes of Result object from on() method invocation. +# +############################################################################### + +# Require UtilityLib.rb and NtpServerLib.rb paths. +require File.expand_path('../../lib/utilitylib.rb', __FILE__) +require File.expand_path('../ntp_serverlib.rb', __FILE__) + +result = 'PASS' +testheader = 'ntp_server Resource :: All Attributes Nondefaults' + +tests = { + agent: agent, + master: master, + intf_type: 'ethernet', + resource_name: 'ntp_server', +} + +# @test_name [TestCase] Executes defaults testcase for ntp_server Resource. +test_name "TestCase :: #{testheader}" do + # Find an available test interface on this device + intf = find_interface(tests) + + # @step [Step] Sets up switch for provider test. + step 'TestStep :: Setup switch for provider test' do + # Cleanup before starting test. + resource_absent_cleanup(agent, 'ntp_auth_key') + resource_absent_cleanup(agent, 'ntp_server') + resource_absent_cleanup(agent, 'cisco_vrf') + # Cleanup after running test. + teardown do + resource_absent_cleanup(agent, 'ntp_auth_key') + resource_absent_cleanup(agent, 'ntp_server') + resource_absent_cleanup(agent, 'cisco_vrf') + end + end + + # @step [Step] Requests manifest from the master server to the agent. + step 'TestStep :: Get resource present manifest from master' do + # Expected exit_code is 0 since this is a bash shell cmd. + on(master, NtpServerLib.create_ntp_server_manifest_present_nondefault(intf)) + + # Expected exit_code is 2 since this is a puppet agent cmd with change. + cmd_str = PUPPET_BINPATH + 'agent -t' + on(agent, cmd_str, acceptable_exit_codes: [2]) + + logger.info("Get resource present manifest from master :: #{result}") + end + + # @step [Step] Checks ntp_server resource on agent using resource cmd. + step 'TestStep :: Check ntp_server resource presence on agent' do + # Expected exit_code is 0 since this is a puppet resource cmd. + # Flag is set to false to check for presence of RegExp pattern in stdout. + cmd_str = PUPPET_BINPATH + 'resource ntp_server 5.5.5.5' + on(agent, cmd_str) do + search_pattern_in_output(stdout, { 'ensure' => 'present' }, + false, self, logger) + search_pattern_in_output(stdout, { 'key' => '1' }, + false, self, logger) + search_pattern_in_output(stdout, { 'maxpoll' => '12' }, + false, self, logger) + search_pattern_in_output(stdout, { 'minpoll' => '6' }, + false, self, logger) + search_pattern_in_output(stdout, { 'prefer' => 'true' }, + false, self, logger) + search_pattern_in_output(stdout, { 'vrf' => 'red' }, + false, self, logger) + end + + logger.info("Check ntp_server resource presence on agent :: #{result}") + end + + # @step [Step] Requests manifest from the master server to the agent. + step 'TestStep :: Get resource absent manifest from master' do + # Expected exit_code is 0 since this is a bash shell cmd. + on(master, NtpServerLib.create_ntp_server_manifest_absent) + + # Expected exit_code is 2 since this is a puppet agent cmd with change. + cmd_str = PUPPET_BINPATH + 'agent -t' + on(agent, cmd_str, acceptable_exit_codes: [2]) + + logger.info("Get resource absent manifest from master :: #{result}") + end + + # @step [Step] Checks ntp_server resource on agent using resource cmd. + step 'TestStep :: Check ntp_server resource absence on agent' do + # Expected exit_code is 0 since this is a puppet resource cmd. + # Flag is set to true to check for absence of RegExp pattern in stdout. + cmd_str = PUPPET_BINPATH + 'resource ntp_server 5.5.5.5' + on(agent, cmd_str) do + search_pattern_in_output(stdout, { 'ensure' => 'present' }, + true, self, logger) + end + + logger.info("Check ntp_server resource absence on agent :: #{result}") + end + + # @raise [PassTest/FailTest] Raises PassTest/FailTest exception using result. + raise_passfail_exception(result, testheader, self, logger) +end + +logger.info("TestCase :: #{testheader} :: End") diff --git a/tests/beaker_tests/ntp_server/ntp_serverlib.rb b/tests/beaker_tests/ntp_server/ntp_serverlib.rb index 3b55b18b2..a78d78c9a 100644 --- a/tests/beaker_tests/ntp_server/ntp_serverlib.rb +++ b/tests/beaker_tests/ntp_server/ntp_serverlib.rb @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2014-2015 Cisco and/or its affiliates. +# Copyright (c) 2014-2017 Cisco and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,9 +35,6 @@ # A library to assist testing ntp_server resource module NtpServerLib - # Group of Constants used in negative tests for ntp_server provider. - ENSURE_NEGATIVE = 'unknown' - # A. Methods to create manifests for ntp_server Puppet provider test cases. # Method to create a manifest for ntp_server resource attribute 'ensure' @@ -70,31 +67,31 @@ def self.create_ntp_server_manifest_absent manifest_str end - # Method to create a manifest for ntp_server resource attribute 'ensure' - # where 'ensure' is set to unknown. - # @param none [None] No input parameters exist. + # Method to create a manifest for ntp_server attributes: + # ensure, timeout, deadtime, encryption_type, encryption_password + # @param intf [String] source_interface # @result none [None] Returns no object. - def self.create_ntp_server_manifest_negative + def self.create_ntp_server_manifest_present_nondefault(intf) manifest_str = "cat <<EOF >#{PUPPETMASTER_MANIFESTPATH} node default { - ntp_server {'5.5.5.5': - ensure => #{NtpServerLib::ENSURE_NEGATIVE}, + ntp_auth_key { '1': + ensure => 'present', + algorithm => 'md5', + mode => '7', + password => 'test', } -} -EOF" - manifest_str - end - - # Method to create a manifest for ntp_server resource attribute 'ensure' and 'prefer', - # where 'ensure' is set to present and 'prefer' is set to true. - # @param none [None] No input parameters exist. - # @result none [None] Returns no object. - def self.create_ntp_server_manifest_present_prefer - manifest_str = "cat <<EOF >#{PUPPETMASTER_MANIFESTPATH} -node default { ntp_server {'5.5.5.5': ensure => present, + key => 1, prefer => true, + maxpoll => 12, + minpoll => 6, + source_interface => '#{intf}', + vrf => 'red', + require => [ Cisco_vrf['red'], Ntp_auth_key['1'] ], + } + cisco_vrf { 'red': + ensure => 'present', } } EOF"