[systemd-commits] src/libsystemd-bus
Zbigniew JÄdrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Fri Dec 27 12:48:27 PST 2013
src/libsystemd-bus/test-bus-kernel-benchmark.c | 6 ++++--
src/libsystemd-bus/test-bus-kernel-bloom.c | 6 ++++--
src/libsystemd-bus/test-bus-kernel.c | 6 ++++--
src/libsystemd-bus/test-bus-zero-copy.c | 6 ++++--
4 files changed, 16 insertions(+), 8 deletions(-)
New commits:
commit 79ccff06c19c0ee74b9744928bc40f2ce658fde2
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Fri Dec 27 15:48:07 2013 -0500
bus: fix running tests in parallel
diff --git a/src/libsystemd-bus/test-bus-kernel-benchmark.c b/src/libsystemd-bus/test-bus-kernel-benchmark.c
index 70f4fcd..04627d9 100644
--- a/src/libsystemd-bus/test-bus-kernel-benchmark.c
+++ b/src/libsystemd-bus/test-bus-kernel-benchmark.c
@@ -220,7 +220,7 @@ int main(int argc, char *argv[]) {
MODE_CHART,
} mode = MODE_BISECT;
int i;
- _cleanup_free_ char *bus_name = NULL, *address = NULL;
+ _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL;
_cleanup_close_ int bus_ref = -1;
cpu_set_t cpuset;
size_t result;
@@ -239,7 +239,9 @@ int main(int argc, char *argv[]) {
assert_se(arg_loop_usec > 0);
- bus_ref = bus_kernel_create_bus("deine-mutter", false, &bus_name);
+ assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
+
+ bus_ref = bus_kernel_create_bus(name, false, &bus_name);
if (bus_ref == -ENOENT)
exit(EXIT_TEST_SKIP);
diff --git a/src/libsystemd-bus/test-bus-kernel-bloom.c b/src/libsystemd-bus/test-bus-kernel-bloom.c
index 772831b..0ecad18 100644
--- a/src/libsystemd-bus/test-bus-kernel-bloom.c
+++ b/src/libsystemd-bus/test-bus-kernel-bloom.c
@@ -37,12 +37,14 @@ static void test_one(
bool good) {
_cleanup_close_ int bus_ref = -1;
- _cleanup_free_ char *bus_name = NULL, *address = NULL;
+ _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL;
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
sd_bus *a, *b;
int r;
- bus_ref = bus_kernel_create_bus("deine-mutter", false, &bus_name);
+ assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
+
+ bus_ref = bus_kernel_create_bus(name, false, &bus_name);
if (bus_ref == -ENOENT)
exit(EXIT_TEST_SKIP);
diff --git a/src/libsystemd-bus/test-bus-kernel.c b/src/libsystemd-bus/test-bus-kernel.c
index c78c6d4..9b17a35 100644
--- a/src/libsystemd-bus/test-bus-kernel.c
+++ b/src/libsystemd-bus/test-bus-kernel.c
@@ -33,7 +33,7 @@
int main(int argc, char *argv[]) {
_cleanup_close_ int bus_ref = -1;
- _cleanup_free_ char *bus_name = NULL, *address = NULL;
+ _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL;
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
const char *ua = NULL, *ub = NULL, *the_string = NULL;
@@ -42,7 +42,9 @@ int main(int argc, char *argv[]) {
log_set_max_level(LOG_DEBUG);
- bus_ref = bus_kernel_create_bus("deine-mutter", false, &bus_name);
+ assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
+
+ bus_ref = bus_kernel_create_bus(name, false, &bus_name);
if (bus_ref == -ENOENT)
return EXIT_TEST_SKIP;
diff --git a/src/libsystemd-bus/test-bus-zero-copy.c b/src/libsystemd-bus/test-bus-zero-copy.c
index dff3692..5ad8ed5 100644
--- a/src/libsystemd-bus/test-bus-zero-copy.c
+++ b/src/libsystemd-bus/test-bus-zero-copy.c
@@ -38,7 +38,7 @@
#define STRING_SIZE 123
int main(int argc, char *argv[]) {
- _cleanup_free_ char *bus_name = NULL, *address = NULL;
+ _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL;
uint8_t *p;
sd_bus *a, *b;
int r, bus_ref;
@@ -51,7 +51,9 @@ int main(int argc, char *argv[]) {
log_set_max_level(LOG_DEBUG);
- bus_ref = bus_kernel_create_bus("deine-mutter", false, &bus_name);
+ assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
+
+ bus_ref = bus_kernel_create_bus(name, false, &bus_name);
if (bus_ref == -ENOENT)
return EXIT_TEST_SKIP;
More information about the systemd-commits
mailing list