Commit c6ffcd94 authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfs-client: make client is pseudo-unique

Motivation:
The nfs spec requires, that after restart client presents the same
client id. Though this is not that important for the test client,
however, makes testing more reliable.

Modification:
generate client is string to be

java class name + user + host name.

for example: org.dcache.nfs.v4.client.Main: tigran on nairi

Result:
server friendly test client.

Acked-by: Paul Millar
Acked-by: Lea Morschel
Target: master
parent e3be4fb6
...@@ -527,9 +527,13 @@ public class Main { ...@@ -527,9 +527,13 @@ public class Main {
String domain = "nairi.desy.de"; String domain = "nairi.desy.de";
String name = "dCache.ORG java based client"; String name = "dCache.ORG java based client";
String clientid = this.getClass().getCanonicalName() + ": "
+ ProcessHandle.current().info().user().orElse("<nobody>")
+ "-"
+ ProcessHandle.current().pid() + "@" + InetAddress.getLocalHost().getHostName();
COMPOUND4args args = new CompoundBuilder() COMPOUND4args args = new CompoundBuilder()
.withExchangeId(domain, name, UUID.randomUUID().toString(), 0,state_protect_how4.SP4_NONE ) .withExchangeId(domain, name, clientid, 0, state_protect_how4.SP4_NONE )
.withTag("exchange_id") .withTag("exchange_id")
.build(); .build();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment