summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-09-15 08:40:16 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-09-16 09:47:28 -0500
commit442e00839e4fc3c11506f5c8a9477b465865aecc (patch)
treeeaeeb42c9fac7b02eb5fe5d491dad2e3db1889de /src/test
parent112a7f4696ebb96abdb42df62e1e794e903f66b3 (diff)
Assume that /proc/meminfo can be missing
Travis tests are failing, probably because /proc/meminfo is not available in the test environment. The same might be true in some virtualized systems, so just treat missing /proc/meminfo as a sign that hibernation is not possible.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-fileio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index 4a4ed79c11..3511f3a3a4 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -232,12 +232,16 @@ static void test_executable_is_script(void) {
static void test_status_field(void) {
_cleanup_free_ char *t = NULL, *p = NULL, *s = NULL;
unsigned long long total, buffers;
+ int r;
assert_se(get_status_field("/proc/self/status", "\nThreads:", &t) == 0);
puts(t);
assert_se(streq(t, "1"));
- assert_se(get_status_field("/proc/meminfo", "MemTotal:", &p) == 0);
+ r = get_status_field("/proc/meminfo", "MemTotal:", &p);
+ if (r == -ENOENT)
+ return;
+ assert(r == 0);
puts(p);
assert_se(safe_atollu(p, &total) == 0);