feat(machines): untie dependency with class for filter func
The dependency to the `headscale` struct makes tests harder to do. This change allow to easily add some tests for this quite sensible function.
This commit is contained in:
parent
9c6ce02554
commit
f006860136
2 changed files with 15 additions and 11 deletions
|
@ -219,10 +219,13 @@ func (s *Suite) TestGetACLFilteredPeers(c *check.C) {
|
|||
_, err = testMachine.GetHostInfo()
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
peersOfTestMachine, err := app.getFilteredByACLPeers(testMachine)
|
||||
machines, err := app.ListAllMachines()
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
peersOfAdminMachine, err := app.getFilteredByACLPeers(adminMachine)
|
||||
peersOfTestMachine, err := getFilteredByACLPeers(machines, app.aclRules, testMachine)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
peersOfAdminMachine, err := getFilteredByACLPeers(machines, app.aclRules, adminMachine)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
c.Log(peersOfTestMachine)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue