]> granicus.if.org Git - procps-ng/commitdiff
testsuite:free: total committed memory can be negative (if overcommitted)
authorLukas Märdian <slyon@ubuntu.com>
Wed, 15 Feb 2023 10:02:55 +0000 (11:02 +0100)
committerLukas Märdian <slyon@ubuntu.com>
Wed, 15 Feb 2023 10:02:57 +0000 (11:02 +0100)
E.g. on my system I see this output to "free -vh", which fails the test:
               total        used        free      shared  buff/cache   available
Mem:            23Gi        17Gi       311Mi       2.2Gi       8.1Gi       5.8Gi
Swap:          2.0Gi       1.9Gi       105Mi
Comm:           13Gi        44Gi       -31Gi

testsuite/free.test/free.exp

index 2eae3dfb72a36ff1a4cb75df16dd38ac21d5403d..3d755302596ea0228fad1af1ebc3f0c5ec82f595 100644 (file)
@@ -41,7 +41,7 @@ expect_pass "$test" "^${free_header}Mem:\\s+${memtotal_kb}\\s+\\d+\\s+\\d+\\s+\\
 
 set test "free with commit"
 spawn $free -v
-expect_pass "$test" "^${free_header}Mem:\\s+${memtotal_kb}\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal_kb}\\s+\\d+\\s+\\d+\\s*Comm:\\s+\\d+\\s+\\d+\\s+\\d+\\s*"
+expect_pass "$test" "^${free_header}Mem:\\s+${memtotal_kb}\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal_kb}\\s+\\d+\\s+\\d+\\s*Comm:\\s+\\d+\\s+\\d+\\s+-?\\d+\\s*"
 
 set test "free with negative repeat count"
 spawn $free -c -2