Thank you for your interest in contributing to the Cisco Catalyst 9800 WNC Go SDK! This document explains how you can get involved, the development workflow, and our release process.
Warning
This SDK is under active development. I'll make the breaking changes until v1.0.0. If you give the contribution to this repo, please create an issue before to avoid duplicate work. The remaining tasks to reach v1.0.0 are tracked in Milestone: 1.0.0.
I welcome all kinds of contributions, including:
- 🐞 Bug reports
- 📄 Documentation improvements
- 💡 Feature requests
- 🛠 Code contributions (new features, bug fixes, refactoring)
Before you start coding:
- Check the Issues to avoid duplicate work.
- Open a new issue if your change is significant or affects functionality.
- Fork this repository and create a feature branch from
main. - Follow the Development and Testing guidelines below.
- Submit a pull request to the
mainbranch.
I provide make commands and helper scripts for building, testing, and debugging this SDK.
Before running the build and test commands, you must install dependencies and set up pre-commit hooks:
make deps # Install build and test dependencies
make pre-commit-install # Set up pre-commit hooks for code qualityexport WNC_CONTROLLER="<controller-host-or-ip>"
export WNC_ACCESS_TOKEN="<base64-username:password>"
export WNC_AP_MAC_ADDR="<test-ap-radio-mac-address>" # Pick a MAC Address from ./examples/list_ap.go result.
export WNC_CLIENT_MAC_ADDR="<test-client-mac-address>" # Pick a MAC Address from ./examples/list_clients.go result.
export WNC_AP_WLAN_BSSID="<test-ap-wlan-bssid>" # Pick a BSSID from ./examples/list_wlan.go result.
export WNC_AP_NEIGHBOR_BSSID="<test-ap-neighbor-bssid>" # Pick a BSSID from ./examples/list_neighbors.go result.
make lint # Static analysis
make test-unit # Run unit tests
make test-unit-coverage # Check unit test coverage
make test-integration # Run integration test using live WNCThis SDK includes unit, integration and scenario tests to ensure reliability and compatibility with Cisco Catalyst 9800 controllers.
- Unit tests run without any external dependencies.
- Integration tests require a live WNC instance and valid credentials.
- Scenario tests perform end-to-end operations on a live WNC and may modify its state.
For detailed testing instructions, see TESTING.md.
This repository contains useful debugging and development scripts in the scripts/ directory.
They use curl to access WNC, so they are independent of Go. For detailed usage, see SCRIPT_REFERENCE.md.
Note
This section is for maintainers. Contributors do not need to perform these steps.
GitHub Actions cannot access a live WNC. Reviewers therefore must have a functional WNC development environment to complete reviews.
Ensure you have access to a development Cisco C9800 WNC that enabled RESTCONF and export the required env vars.
Run unit tests as follows:
make test-unitRun integration tests as follows:
make test-integrationRun scenario tests as follows:
# Run AP Admin State Change and AP Radio State Change Test
go test ./tests/scenario/ap/ -tags=scenario -run AdminStateManagement -v
go test ./tests/scenario/ap/ -tags=scenario -run RadioStateManagement -v
# Run RF Tag, Site Tag and Policy Tag Test
go test ./tests/scenario/rf/ -tags=scenario -run TagLifecycleManagement -v
go test ./tests/scenario/site/ -tags=scenario -run TagLifecycleManagement -v
go test ./tests/scenario/wlan/ -tags=scenario -run TagLifecycleManagement -vRun the example application listed in the README.md Usecases section.
Warning
example/reload_ap and example/reload_controller will reboot the AP and controller. This causes downtime.
Generate and commit coverage reports:
make test-unit-coverage # writes coverage/report.html and coverage/report.out
octocov badge coverage --out docs/assets/coverage.svg # generates coverage badgeCommit coverage artifacts and badge:
coverage/report.out- coverprofile for CIcoverage/report.html- human-readable reportdocs/assets/coverage.svg- coverage badge
Push the coverage artifacts and badge to the PR.
Note
This section is for maintainers. Contributors do not need to perform these steps.
To release a new version:
- Update the version in the
VERSIONfile. - Submit a pull request with the updated
VERSIONfile.
Once merged, GitHub Actions will automatically release the new version using Release Workflow.
- N/A