mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-13 15:21:30 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user