info_windows_test.go 661 B

1234567891011121314151617181920212223
  1. //go:build windows
  2. package localapi
  3. import (
  4. "context"
  5. "testing"
  6. "github.com/slackhq/nebula/commands"
  7. "github.com/slackhq/nebula/test"
  8. "github.com/stretchr/testify/assert"
  9. "github.com/stretchr/testify/require"
  10. )
  11. // TestInfoIsNotServedOnWindows: a pipe has no mode to open to other accounts, so Rebind
  12. // says so and leaves nothing listening, whatever the config asked for.
  13. func TestInfoIsNotServedOnWindows(t *testing.T) {
  14. s := NewInfoServer(test.NewLogger(), commands.New())
  15. err := s.Rebind(context.Background(), pipePrefix+"nebula-info-test", Access{Mode: 0600})
  16. require.ErrorIs(t, err, errInfoUnsupported)
  17. assert.Empty(t, s.Path())
  18. s.Stop()
  19. }