File: configuration_nowindows_test.go

package info (click to toggle)
notary 0.6.1~ds1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,692 kB
  • sloc: python: 1,112; sh: 481; makefile: 181; sql: 155
file content (24 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// +build !windows

package utils

import (
	"syscall"
	"testing"

	"github.com/sirupsen/logrus"
	"github.com/stretchr/testify/require"
)

func TestLogLevelSignalHandle(t *testing.T) {
	signalOperation := map[bool]syscall.Signal{
		optIncrement: syscall.SIGUSR1,
		optDecrement: syscall.SIGUSR2,
	}

	for _, expt := range logLevelExpectations {
		logrus.SetLevel(expt.startLevel)
		LogLevelSignalHandle(signalOperation[expt.increment])
		require.Equal(t, expt.endLevel, logrus.GetLevel())
	}
}