summaryrefslogtreecommitdiff
path: root/testcases
diff options
context:
space:
mode:
Diffstat (limited to 'testcases')
-rw-r--r--testcases/010-cpu-usage/expected_output.txt1
-rw-r--r--testcases/010-cpu-usage/i3status.conf12
-rw-r--r--testcases/010-cpu-usage/stat3
-rw-r--r--testcases/011-cpu-usage/expected_output.txt1
-rw-r--r--testcases/011-cpu-usage/i3status.conf12
-rw-r--r--testcases/011-cpu-usage/stat3
-rw-r--r--testcases/012-cpu-usage-error/expected_output.txt1
-rw-r--r--testcases/012-cpu-usage-error/i3status.conf12
-rw-r--r--testcases/012-cpu-usage-error/stat2
-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
12 files changed, 62 insertions, 0 deletions
diff --git a/testcases/010-cpu-usage/expected_output.txt b/testcases/010-cpu-usage/expected_output.txt
new file mode 100644
index 0000000..336596e
--- /dev/null
+++ b/testcases/010-cpu-usage/expected_output.txt
@@ -0,0 +1 @@
+all: 75% CPU_0: 100% CPU_1: 50%
diff --git a/testcases/010-cpu-usage/i3status.conf b/testcases/010-cpu-usage/i3status.conf
new file mode 100644
index 0000000..57cddf2
--- /dev/null
+++ b/testcases/010-cpu-usage/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/010-cpu-usage/stat"
+ max_threshold = 90
+ degraded_threshold = 75
+}
diff --git a/testcases/010-cpu-usage/stat b/testcases/010-cpu-usage/stat
new file mode 100644
index 0000000..6fbc94e
--- /dev/null
+++ b/testcases/010-cpu-usage/stat
@@ -0,0 +1,3 @@
+cpu 0 0 0 0 0 0 0 0 0 0
+cpu0 100 0 0 0 0 0 0 0 0 0
+cpu1 50 0 0 50 0 0 0 0 0 0
diff --git a/testcases/011-cpu-usage/expected_output.txt b/testcases/011-cpu-usage/expected_output.txt
new file mode 100644
index 0000000..930a2b5
--- /dev/null
+++ b/testcases/011-cpu-usage/expected_output.txt
@@ -0,0 +1 @@
+all: 50% CPU_0: 00% CPU_1: 100%
diff --git a/testcases/011-cpu-usage/i3status.conf b/testcases/011-cpu-usage/i3status.conf
new file mode 100644
index 0000000..39320d3
--- /dev/null
+++ b/testcases/011-cpu-usage/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/011-cpu-usage/stat"
+ max_threshold = 90
+ degraded_threshold = 75
+}
diff --git a/testcases/011-cpu-usage/stat b/testcases/011-cpu-usage/stat
new file mode 100644
index 0000000..9c77e7e
--- /dev/null
+++ b/testcases/011-cpu-usage/stat
@@ -0,0 +1,3 @@
+cpu 0 0 0 0 0 0 0 0 0 0
+cpu0 0 0 0 300 0 0 0 0 0 0
+cpu1 100 100 100 0 0 0 0 0 0 0
diff --git a/testcases/012-cpu-usage-error/expected_output.txt b/testcases/012-cpu-usage-error/expected_output.txt
new file mode 100644
index 0000000..3a74003
--- /dev/null
+++ b/testcases/012-cpu-usage-error/expected_output.txt
@@ -0,0 +1 @@
+cant read cpu usage
diff --git a/testcases/012-cpu-usage-error/i3status.conf b/testcases/012-cpu-usage-error/i3status.conf
new file mode 100644
index 0000000..285d415
--- /dev/null
+++ b/testcases/012-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/012-cpu-usage-error/stat"
+ max_threshold = 90
+ degraded_threshold = 75
+}
diff --git a/testcases/012-cpu-usage-error/stat b/testcases/012-cpu-usage-error/stat
new file mode 100644
index 0000000..cb9b6e3
--- /dev/null
+++ b/testcases/012-cpu-usage-error/stat
@@ -0,0 +1,2 @@
+cpu 0 0 0 0 0 0 0 0 0 0
+cpu0 100 0 0 0 0 0 0 0 0 0
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