Is there a way to mock interface?
Open
question
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 184
- PR merge metrics
- No merged PRs in 30d
Description
I would like to Unit Test my NFT code. Is there a way to mock interfaces of Conn, Set, Rule and expressions? I.e. I want to apply some rules to the chain and print out results so that it could be tested against expected rules.
In current implementation I encounter problem that UT must be executed using sudo as rules are applied directly to NFT: https://github.com/google/nftables/blob/main/nftables_test.go
Contributor guide
Assessment
This issue has not been assessed yet.