{"id":16139404,"url":"https://github.com/networkop/simple-cisco-tdd","last_synced_at":"2025-03-18T16:31:09.710Z","repository":{"id":83590214,"uuid":"37656451","full_name":"networkop/simple-cisco-tdd","owner":"networkop","description":null,"archived":false,"fork":false,"pushed_at":"2015-07-12T04:43:36.000Z","size":156,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-02-28T10:52:48.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networkop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-18T11:49:39.000Z","updated_at":"2020-12-01T03:04:43.000Z","dependencies_parsed_at":"2023-03-01T12:15:47.777Z","dependency_job_id":null,"html_url":"https://github.com/networkop/simple-cisco-tdd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsimple-cisco-tdd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsimple-cisco-tdd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsimple-cisco-tdd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fsimple-cisco-tdd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networkop","download_url":"https://codeload.github.com/networkop/simple-cisco-tdd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243940108,"owners_count":20372045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T23:48:59.063Z","updated_at":"2025-03-18T16:31:09.452Z","avatar_url":"https://github.com/networkop.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## SIMPLE NETWORK TDD FRAMEWORK\n\n\nThis framework creates a convenient way to test and verify routing within a redundant, highly-available network topology.\nIt tries to emulate behaviour of BDD frameworks like [Cucumber][cucumber-link] or [Lettuce][lettuce-link]. It uses business-friendly traffic scenarios to verify traffic flows within the network. Another use may be in network failover testing where it can verify traffic re-routing behaviour under specific network failure conditions. For example, a scenario to verify that a traffic from a Data Centre to Branch Office \"A\" will traverse routers R11 and R21 would look like `1.1 From DC-CORE to BR1-CORE via R11, R21`.  This network TDD framework uses Ansible to build a local IP-to-Hostname database and run multiple parallel traceroutes.  \n\nThis network TDD framework is designed with the following assumptions:\n\n* All routing is performed within global VRFs \n* All devices are reachable\n* ICMP responses are allowed throughout the network\n* All network devices have ssh enabled\n\n## QUICKSTART GUIDE\n\nThis guide assumes the following prerequisites have been met:\n\n* Ansible is installed on the test machine\n* Test machine has access to all network devices\n\n### Clone git repository\n\n``` bash\ngit clone https://github.com/networkop/simple-cisco-tdd.git tdd-network\ncd tdd-network\n```\n\n### Populate local inventory\n\nEdit `./myhosts` with information about all relevant network devices. Edit `hosts_var` directory files with host-specific authentication and IP address details ([full list of inventory options][ansible-inventory]). Verify that Ansible can talk to network devices:\n\n``` bash\nansible R1 -u cisco -m raw -a \"show clock\"\nR1 | success | rc=0 \u003e\u003e\n\n*00:56:06.213 UTC Sat Jul 11 2015\n```\n\n### Create traffic scenarios\n\nEdit `./scenarios/all.txt` file to match your environment. The file contains a list of scenarios representing a certain state in the network. Each scenario has one or more scenario steps, representing a particular traffic flow. The keywords in scenario steps are `From`, `To` and `Via`. The first two can only contain a single device name, while `Via` can contain a comma-separated ordered list of devices. The framework will verify that each of the devices in `Via` is traversed in the order specified in the list.\n\n``` text\n1. Testing of Primary Link\n1.1 From R1 to R3 via R2\n1.2 From R1 to R4 via R2, R3\n1.3 From R2 to R4 via R3\n1.4 From R1 to R2 via R2\n2. Testing of Backup Link\n2.1 From R1 to R3 via R4\n2.2 From R1 to R2 via R4,R3\n```\n\n### Collect IP address information and process scenarios\n\nRun `cisco-ip-collect.yml` playbook. This playbook contains two plays tagged `collect` and `scenario`. If either IP addressing or scenario file are changed the corresponding play needs to be re-run.\nThe result of the play is a new file `./group_vars/all.yml`\n\n``` bash\nansible-playbook cisco-ip-collect.yml\n```\n\n### Run TDD play to verify a scenario\n\nSelect which scenario to run and watch for errors.\n\n``` bash\nansible-playbook cisco_tdd.yml\nEnter scenario number [1]: 1\n```\n\nIf all scenarios were successful Ansible should return no errors. In case one or more scenario steps failed, the error will be displayed:\n\n``` bash\nmsg: Failed scenario Primary WAN failed at Branch #2.\nTraceroute from DC-CORE to BR2-CORE has not traversed ['DC-WAN1', 'BR1-WAN1']\n Actual path taken: DC-CORE -\u003e DC-WAN1 -\u003e 1.1.1.2 -\u003e BR2-WAN1 -\u003e BR2-CORE\n```\n\n[cucumber-link]: https://cucumber.io/\n[lettuce-link]: http://lettuce.it/\n[ansible-inventory]: http://docs.ansible.com/intro_inventory.html#list-of-behavioral-inventory-parameters\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Fsimple-cisco-tdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworkop%2Fsimple-cisco-tdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Fsimple-cisco-tdd/lists"}