summaryrefslogtreecommitdiff
path: root/testcases/013-cpu-usage-error
diff options
context:
space:
mode:
authoreplanet <emeric.planet@gmail.com>2017-03-26 12:54:07 +0200
committerMichael Stapelberg <stapelberg@users.noreply.github.com>2017-03-26 06:54:07 -0400
commit94651257cea4ff419f9cf2143d93193d5a5ccb96 (patch)
treeca563d7570df6c8e84e93a04ecf85037ab77eae8 /testcases/013-cpu-usage-error
parent3ae0decbb33015fb111cdf7ea3d117bd6988cc05 (diff)
Multiple CPU support for cpu_usage (#209)
This change addresses the issue #199 asking for multiple CPU support. It takes an arbitrary CPU number and outputs its usage using the same arithmetics as for CPU aggregation. It currently doesn't support FreeBSD.
Diffstat (limited to 'testcases/013-cpu-usage-error')
-rw-r--r--testcases/013-cpu-usage-error/expected_output.txt1
-rw-r--r--testcases/013-cpu-usage-error/i3status.conf12
-rw-r--r--testcases/013-cpu-usage-error/stat2
3 files changed, 15 insertions, 0 deletions
diff --git a/testcases/013-cpu-usage-error/expected_output.txt b/testcases/013-cpu-usage-error/expected_output.txt
new file mode 100644
index 0000000..3a74003
--- /dev/null
+++ b/testcases/013-cpu-usage-error/expected_output.txt
@@ -0,0 +1 @@
+cant read cpu usage
diff --git a/testcases/013-cpu-usage-error/i3status.conf b/testcases/013-cpu-usage-error/i3status.conf
new file mode 100644
index 0000000..a55934e
--- /dev/null
+++ b/testcases/013-cpu-usage-error/i3status.conf
@@ -0,0 +1,12 @@
+general {
+ output_format = "none"
+}
+
+order += "cpu_usage"
+
+cpu_usage {
+ format = "all: %usage CPU_0: %cpu0 CPU_1: %cpu1"
+ path = "testcases/013-cpu-usage-error/stat"
+ max_threshold = 90
+ degraded_threshold = 75
+}
diff --git a/testcases/013-cpu-usage-error/stat b/testcases/013-cpu-usage-error/stat
new file mode 100644
index 0000000..3ded833
--- /dev/null
+++ b/testcases/013-cpu-usage-error/stat
@@ -0,0 +1,2 @@
+cpu0 100 0 0 0 0 0 0 0 0 0
+cpu1 50 0 0 50 0 0 0 0 0 0