Skip to content

Commit 2fb942a

Browse files
committed
Change arguments of the ipc_devdax_prov test
Change arguments of the ipc_devdax_prov test: - the producer uses the devdax device (given by UMF_TESTS_DEVDAX_PATH and UMF_TESTS_DEVDAX_SIZE variables) - the consumer is started in the IPC-consumer-only mode with no devdax device given (path==NULL && size==0). Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
1 parent 1275613 commit 2fb942a

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

test/ipc_devdax_prov.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ echo "Waiting 1 sec ..."
3131
sleep 1
3232

3333
echo "Starting ipc_devdax_prov PRODUCER on port $PORT ..."
34-
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_devdax_prov_producer $PORT
34+
UMF_LOG=$UMF_LOG_VAL ./umf_test-ipc_devdax_prov_producer $PORT $UMF_TESTS_DEVDAX_PATH $UMF_TESTS_DEVDAX_SIZE

test/ipc_devdax_prov_consumer.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@
1414
#include "ipc_os_prov_common.h"
1515

1616
int main(int argc, char *argv[]) {
17-
if (argc < 2) {
18-
fprintf(stderr, "usage: %s <port>\n", argv[0]);
17+
if (argc < 2 || argc == 3) {
18+
fprintf(stderr, "usage: %s <port> [path_devdax] [size_devdax]\n",
19+
argv[0]);
20+
if (argc == 3) {
21+
fprintf(stderr, "error: both [path_devdax] and [size_devdax] have "
22+
"to be provided, not only one of them\n");
23+
}
24+
1925
return -1;
2026
}
2127

2228
int port = atoi(argv[1]);
29+
char *path = NULL;
30+
char *size = "0";
2331

24-
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
25-
if (path == NULL || path[0] == 0) {
26-
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_PATH is not set\n");
27-
return 0;
28-
}
29-
30-
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
31-
if (size == NULL || size[0] == 0) {
32-
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_SIZE is not set\n");
33-
return 0;
32+
if (argc >= 4) {
33+
path = argv[2];
34+
size = argv[3];
3435
}
3536

3637
umf_devdax_memory_provider_params_t devdax_params =

test/ipc_devdax_prov_producer.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@
1414
#include "ipc_os_prov_common.h"
1515

1616
int main(int argc, char *argv[]) {
17-
if (argc < 2) {
18-
fprintf(stderr, "usage: %s <port>\n", argv[0]);
17+
if (argc < 2 || argc == 3) {
18+
fprintf(stderr, "usage: %s <port> [path_devdax] [size_devdax]\n",
19+
argv[0]);
20+
if (argc == 3) {
21+
fprintf(stderr, "error: both [path_devdax] and [size_devdax] have "
22+
"to be provided, not only one of them\n");
23+
}
24+
1925
return -1;
2026
}
2127

2228
int port = atoi(argv[1]);
29+
char *path = NULL;
30+
char *size = "0";
2331

24-
char *path = getenv("UMF_TESTS_DEVDAX_PATH");
25-
if (path == NULL || path[0] == 0) {
26-
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_PATH is not set\n");
27-
return 0;
28-
}
29-
30-
char *size = getenv("UMF_TESTS_DEVDAX_SIZE");
31-
if (size == NULL || size[0] == 0) {
32-
fprintf(stderr, "Test skipped, UMF_TESTS_DEVDAX_SIZE is not set\n");
33-
return 0;
32+
if (argc >= 4) {
33+
path = argv[2];
34+
size = argv[3];
3435
}
3536

3637
umf_devdax_memory_provider_params_t devdax_params =

0 commit comments

Comments
 (0)