diff --git a/testsuite_cli_test.go b/testsuite_cli_test.go index a3320b2..be09005 100644 --- a/testsuite_cli_test.go +++ b/testsuite_cli_test.go @@ -112,11 +112,11 @@ func TestCli(t *testing.T) { {args: []string{"xyz"}, code: 13, stderrContains: "extra argument not understood", stdoutEmpty: true}, {args: []string{"-i", "1"}, code: 13, stderrContains: "extra argument not understood", stdoutEmpty: true}, // Tuples - {args: []string{"-m", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem <= 2.00% and swap <= 10.00%", stdoutContains: memReport}, + {args: []string{"-m", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem avail <= 2.00% and swap free <= 10.00%", stdoutContains: memReport}, {args: []string{"-m", "1,2"}, code: -1, stdoutContains: memReport}, {args: []string{"-m", "1,-1"}, code: 15, stderrContains: "fatal", stdoutEmpty: true}, {args: []string{"-m", "1000,-1000"}, code: 15, stderrContains: "fatal", stdoutEmpty: true}, - {args: []string{"-s", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem <= 10.00% and swap <= 2.00%", stdoutContains: memReport}, + {args: []string{"-s", "2,1"}, code: -1, stderrContains: "sending SIGTERM when mem avail <= 10.00% and swap free <= 2.00%", stdoutContains: memReport}, {args: []string{"-s", "1,2"}, code: -1, stdoutContains: memReport}, // /~https://github.com/rfjakob/earlyoom/issues/97 {args: []string{"-m", "5,0"}, code: -1, stdoutContains: memReport}, @@ -135,18 +135,18 @@ func TestCli(t *testing.T) { {args: []string{"-s", tooBigInt32}, code: 16, stderrContains: "fatal", stdoutEmpty: true}, {args: []string{"-s", tooBigUint32}, code: 16, stderrContains: "fatal", stdoutEmpty: true}, // Floating point values - {args: []string{"-m", "3.14"}, code: -1, stderrContains: "SIGTERM when mem <= 3.14%", stdoutContains: memReport}, - {args: []string{"-m", "7,3.14"}, code: -1, stderrContains: "SIGKILL when mem <= 3.14%", stdoutContains: memReport}, - {args: []string{"-s", "12.34"}, code: -1, stderrContains: "swap <= 12.34%", stdoutContains: memReport}, + {args: []string{"-m", "3.14"}, code: -1, stderrContains: "SIGTERM when mem avail <= 3.14%", stdoutContains: memReport}, + {args: []string{"-m", "7,3.14"}, code: -1, stderrContains: "SIGKILL when mem avail <= 3.14%", stdoutContains: memReport}, + {args: []string{"-s", "12.34"}, code: -1, stderrContains: "swap free <= 12.34%", stdoutContains: memReport}, // Use both -m/-M - {args: []string{"-m", "10", "-M", mem1percent}, code: -1, stderrContains: "SIGTERM when mem <= 1.00%", stdoutContains: memReport}, + {args: []string{"-m", "10", "-M", mem1percent}, code: -1, stderrContains: "SIGTERM when mem avail <= 1.00%", stdoutContains: memReport}, } if swapTotal > 0 { // Tests that cannot work when there is no swap enabled tc := []cliTestCase{ {args: []string{"-S", swap2percent}, code: -1, stderrContains: " 2.00%", stdoutContains: memReport}, // Use both -s/-S - {args: []string{"-s", "10", "-S", swap2percent}, code: -1, stderrContains: "swap <= 1.00%", stdoutContains: memReport}, + {args: []string{"-s", "10", "-S", swap2percent}, code: -1, stderrContains: "swap free <= 1.00%", stdoutContains: memReport}, } testcases = append(testcases, tc...) }