Merge pull request #284 from Hackerpilot/unix-domain-sockets

Unix domain sockets
This commit is contained in:
Brian Schott 2016-01-19 17:23:11 -08:00
commit 82ecc2d27a
35 changed files with 340 additions and 123 deletions

View File

@ -60,6 +60,23 @@ the issue.)
1. ```dub build --build=release --config=server``` 1. ```dub build --build=release --config=server```
# Sockets
## TCP
On Windows DCD will use TCP sockets to communicate between the client and server.
Other operating systems can use TCP sockets if the client and server use the `--tcp`
command-line switch.
## UNIX domain sockets
Operating systems that support UNIX domain sockets will use them by default.
#### OSX
The socket will be created at `/var/tmp/dcd-${UID}.socket`
#### Linux/BSD
The client and server will attempt to create the socket in the following locations:
* `${XDG_RUNTIME_DIR}/dcd.socket`
* `/tmp/dcd-${UID}.socket`
# Client # Client
Because DCD is designed to be used from a text editor, this section is written Because DCD is designed to be used from a text editor, this section is written
primarily for plugin authors. primarily for plugin authors.

View File

@ -1,4 +1,4 @@
.TH dcd-client 1 "Oct 30 2015" "" https://github.com/Hackerpilot/DCD .TH dcd-client 1 "Jan 15 2016" "" https://github.com/Hackerpilot/DCD
.SH NAME .SH NAME
dcd-client \- autocompletion client for the D programming language dcd-client \- autocompletion client for the D programming language
.PD .PD
@ -6,6 +6,8 @@ dcd-client \- autocompletion client for the D programming language
.SY dcd-client .SY dcd-client
.OP "\-c, \-\-cursorPos" cursorPosition .OP "\-c, \-\-cursorPos" cursorPosition
.OP "\-p, \-\-port" portNumber .OP "\-p, \-\-port" portNumber
.OP \-\-tcp
.OP \-\-socketFile filePath
.OP "\-I" directory .OP "\-I" directory
.OP "\-h, \-\-help" .OP "\-h, \-\-help"
.OP "\-l, \-\-symbolLocation" .OP "\-l, \-\-symbolLocation"
@ -34,7 +36,20 @@ position is measured in bytes from the beginning of the source code.
.RS .RS
Choose the port number on which Choose the port number on which
.B dcd-client .B dcd-client
listens. listens. This has no effect unless
.B dcd-client
is being run on Windows or the \-\-tcp switch is used.
.RE
.B \-\-tcp
.RS
Listen on a TCP socket instead of a UNIX domain socket. This is the default on
Windows.
.RE
.B \-\-socketFile
.I filePath
.RS
Set the path to use for the UNIX domain socket. Has no effect if the \-\-tcp
switch is used.
.RE .RE
.B \-I .B \-I
.I directory .I directory

View File

@ -1,4 +1,4 @@
.TH dcd-server 1 "Oct 30 2015" "" https://github.com/Hackerpilot/DCD .TH dcd-server 1 "Jan 15 2016" "" https://github.com/Hackerpilot/DCD
.SH NAME .SH NAME
dcd-server \- autocompletion server for the D programming language dcd-server \- autocompletion server for the D programming language
.PD .PD
@ -6,6 +6,8 @@ dcd-server \- autocompletion server for the D programming language
.SY dcd-server .SY dcd-server
.OP \-I directory .OP \-I directory
.OP \-p|\-\-port portNumber .OP \-p|\-\-port portNumber
.OP \-\-tcp
.OP \-\-socketFile filePath
.OP \-\-logLevel level .OP \-\-logLevel level
.OP \-h|\-\-help .OP \-h|\-\-help
.OP \-\-version .OP \-\-version
@ -20,7 +22,20 @@ dcd-server \- autocompletion server for the D programming language
.RS .RS
Choose the port number on which Choose the port number on which
.B dcd-server .B dcd-server
listens. listens. This has no effect unless
.B dcd-server
is being run on Windows or the \-\-tcp switch is used.
.RE
.B \-\-tcp
.RS
Listen on a TCP socket instead of a UNIX domain socket. This is the default on
Windows.
.RE
.B \-\-socketFile
.I filePath
.RS
Set the path to use for the UNIX domain socket. Has no effect if the \-\-tcp
switch is used.
.RE .RE
.B \-\-logLevel .B \-\-logLevel
.I level .I level
@ -60,10 +75,10 @@ This file should be placed in one of the following locations:
.I /etc/dcd.conf .I /etc/dcd.conf
.RE .RE
.IP \(bu .IP \(bu
.I $XDG_CONFIG_HOME/dcd/dcd.conf .I ${XDG_CONFIG_HOME}/dcd/dcd.conf
.RE .RE
.IP \(bu .IP \(bu
.I $HOME/.config/dcd/dcd.conf .I ${HOME}/.config/dcd/dcd.conf
.RE .RE
Each line in the file should be a path to search for D source files. A line in Each line in the file should be a path to search for D source files. A line in
@ -73,6 +88,18 @@ is equivalent to passing that same line to
with the with the
.I -I .I -I
option. Lines that start with the '#' character are ignored. option. Lines that start with the '#' character are ignored.
Unless the \-\-tcp switch is used,
.B dcd-server
will default to communicating with the client over a UNIX domain socket.
.B dcd-server
will attempt to create the socket in the following locations:
.IP \(bu
.I ${XDG_RUNTIME_DIR}/dcd.socket
.RE
.IP \(bu
.I /tmp/dcd-${UID}.socket
.RE
.SH AUTHOR .SH AUTHOR
Written by Brian Schott (@Hackerpilot on Github) Written by Brian Schott (@Hackerpilot on Github)
.PD .PD

View File

@ -33,6 +33,7 @@ import std.experimental.logger;
import msgpack; import msgpack;
import common.messages; import common.messages;
import common.dcd_version; import common.dcd_version;
import common.socket;
int main(string[] args) int main(string[] args)
{ {
@ -48,6 +49,16 @@ int main(string[] args)
bool printVersion; bool printVersion;
bool listImports; bool listImports;
string search; string search;
version(Windows)
{
bool useTCP = true;
string socketFile;
}
else
{
bool useTCP = false;
string socketFile = generateSocketName();
}
try try
{ {
@ -55,7 +66,8 @@ int main(string[] args)
"port|p", &port, "help|h", &help, "shutdown", &shutdown, "port|p", &port, "help|h", &help, "shutdown", &shutdown,
"clearCache", &clearCache, "symbolLocation|l", &symbolLocation, "clearCache", &clearCache, "symbolLocation|l", &symbolLocation,
"doc|d", &doc, "query|status|q", &query, "search|s", &search, "doc|d", &doc, "query|status|q", &query, "search|s", &search,
"version", &printVersion, "listImports", &listImports); "version", &printVersion, "listImports", &listImports,
"tcp", &useTCP, "socketFile", &socketFile);
} }
catch (ConvException e) catch (ConvException e)
{ {
@ -66,6 +78,12 @@ int main(string[] args)
AutocompleteRequest request; AutocompleteRequest request;
if (help)
{
printHelp(args[0]);
return 0;
}
if (printVersion) if (printVersion)
{ {
version (Windows) version (Windows)
@ -76,16 +94,21 @@ int main(string[] args)
write(DCD_VERSION, " ", GIT_HASH); write(DCD_VERSION, " ", GIT_HASH);
return 0; return 0;
} }
else if (help)
version (Windows) if (socketFile !is null)
{ {
printHelp(args[0]); fatal("UNIX domain sockets not supported on Windows");
return 0; return 1;
} }
else if (query)
if (useTCP)
socketFile = null;
if (query)
{ {
try try
{ {
TcpSocket socket = createSocket(port); Socket socket = createSocket(socketFile, port);
scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); } scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); }
request.kind = RequestKind.query; request.kind = RequestKind.query;
if (sendRequest(socket, request)) if (sendRequest(socket, request))
@ -112,7 +135,7 @@ int main(string[] args)
request.kind = RequestKind.shutdown; request.kind = RequestKind.shutdown;
else if (clearCache) else if (clearCache)
request.kind = RequestKind.clearCache; request.kind = RequestKind.clearCache;
TcpSocket socket = createSocket(port); Socket socket = createSocket(socketFile, port);
scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); } scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); }
return sendRequest(socket, request) ? 0 : 1; return sendRequest(socket, request) ? 0 : 1;
} }
@ -122,7 +145,7 @@ int main(string[] args)
request.importPaths = importPaths.map!(a => absolutePath(a)).array; request.importPaths = importPaths.map!(a => absolutePath(a)).array;
if (cursorPos == size_t.max) if (cursorPos == size_t.max)
{ {
TcpSocket socket = createSocket(port); Socket socket = createSocket(socketFile, port);
scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); } scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); }
if (!sendRequest(socket, request)) if (!sendRequest(socket, request))
return 1; return 1;
@ -132,7 +155,7 @@ int main(string[] args)
else if (listImports) else if (listImports)
{ {
request.kind |= RequestKind.listImports; request.kind |= RequestKind.listImports;
TcpSocket socket = createSocket(port); Socket socket = createSocket(socketFile, port);
scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); } scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); }
sendRequest(socket, request); sendRequest(socket, request);
AutocompleteResponse response = getResponse(socket); AutocompleteResponse response = getResponse(socket);
@ -194,7 +217,7 @@ int main(string[] args)
request.kind |= RequestKind.autocomplete; request.kind |= RequestKind.autocomplete;
// Send message to server // Send message to server
TcpSocket socket = createSocket(port); Socket socket = createSocket(socketFile, port);
scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); } scope (exit) { socket.shutdown(SocketShutdown.BOTH); socket.close(); }
if (!sendRequest(socket, request)) if (!sendRequest(socket, request))
return 1; return 1;
@ -266,16 +289,33 @@ Options:
--port PORTNUMBER | -p PORTNUMBER --port PORTNUMBER | -p PORTNUMBER
Uses PORTNUMBER to communicate with the server instead of the default Uses PORTNUMBER to communicate with the server instead of the default
port 9166.`, programName); port 9166. Only used on Windows or when the --tcp option is set.
--tcp
Send requests on a TCP socket instead of a UNIX domain socket. This
switch has no effect on Windows.
--socketFile FILENAME
Use the given FILENAME as the path to the UNIX domain socket. Using
this switch is an error on Windows.`, programName);
} }
TcpSocket createSocket(ushort port) Socket createSocket(string socketFile, ushort port)
{ {
import core.time : dur; import core.time : dur;
TcpSocket socket = new TcpSocket(AddressFamily.INET); Socket socket;
socket.setOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, dur!"seconds"(5)); if (socketFile is null)
{
socket = new TcpSocket(AddressFamily.INET);
socket.connect(new InternetAddress("localhost", port)); socket.connect(new InternetAddress("localhost", port));
}
else
{
socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
socket.connect(new UnixAddress(socketFile));
}
socket.setOption(SocketOptionLevel.SOCKET, SocketOption.RCVTIMEO, dur!"seconds"(5));
socket.blocking = true; socket.blocking = true;
return socket; return socket;
} }
@ -283,7 +323,7 @@ TcpSocket createSocket(ushort port)
/** /**
* Returns: true on success * Returns: true on success
*/ */
bool sendRequest(TcpSocket socket, AutocompleteRequest request) bool sendRequest(Socket socket, AutocompleteRequest request)
{ {
ubyte[] message = msgpack.pack(request); ubyte[] message = msgpack.pack(request);
ubyte[] messageBuffer = new ubyte[message.length + message.length.sizeof]; ubyte[] messageBuffer = new ubyte[message.length + message.length.sizeof];
@ -296,7 +336,7 @@ bool sendRequest(TcpSocket socket, AutocompleteRequest request)
/** /**
* Gets the response from the server * Gets the response from the server
*/ */
AutocompleteResponse getResponse(TcpSocket socket) AutocompleteResponse getResponse(Socket socket)
{ {
ubyte[1024 * 16] buffer; ubyte[1024 * 16] buffer;
auto bytesReceived = socket.receive(buffer); auto bytesReceived = socket.receive(buffer);

View File

@ -21,7 +21,7 @@ module common.dcd_version;
/** /**
* Human-readable version number * Human-readable version number
*/ */
enum DCD_VERSION = "v0.7.5"; enum DCD_VERSION = "v0.8.0-alpha1";
version (Windows) {} version (Windows) {}
else version (built_with_dub) {} else version (built_with_dub) {}

45
src/common/socket.d Normal file
View File

@ -0,0 +1,45 @@
/**
* This file is part of DCD, a development tool for the D programming language.
* Copyright (C) 2015 Brian Schott
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
module common.socket;
import core.sys.posix.unistd; // getuid
import std.format;
import std.process;
import std.path;
version (OSX) version = haveUnixSockets;
version (linux) version = haveUnixSockets;
version (BSD) version = haveUnixSockets;
version (FreeBSD) version = haveUnixSockets;
string generateSocketName()
{
version (haveUnixSockets)
{
immutable string socketFileName = "dcd-%d.socket".format(getuid());
version (OSX)
return buildPath("/", "var", "tmp", socketFileName);
else
{
immutable string xdg = environment.get("XDG_RUNTIME_DIR");
return xdg is null ? buildPath("/", "tmp", socketFileName) : buildPath(xdg,
"dcd.socket");
}
}
}

View File

@ -18,30 +18,33 @@
module server.server; module server.server;
import std.socket; import core.sys.posix.sys.stat;
import std.stdio;
import std.getopt;
import std.algorithm; import std.algorithm;
import std.path;
import std.file;
import std.array; import std.array;
import std.process;
import std.datetime;
import std.conv; import std.conv;
import std.datetime;
import std.exception : enforce;
import std.experimental.allocator; import std.experimental.allocator;
import std.experimental.allocator.mallocator; import std.experimental.allocator.mallocator;
import std.exception : enforce;
import std.experimental.logger; import std.experimental.logger;
import std.file;
import std.file;
import std.getopt;
import std.path;
import std.process;
import std.socket;
import std.stdio;
import msgpack; import msgpack;
import dsymbol.string_interning; import dsymbol.string_interning;
import common.dcd_version;
import common.messages; import common.messages;
import server.autocomplete; import common.socket;
import dsymbol.modulecache; import dsymbol.modulecache;
import dsymbol.symbol; import dsymbol.symbol;
import common.dcd_version; import server.autocomplete;
/// Name of the server configuration file /// Name of the server configuration file
enum CONFIG_FILE_NAME = "dcd.conf"; enum CONFIG_FILE_NAME = "dcd.conf";
@ -59,12 +62,22 @@ int main(string[] args)
bool ignoreConfig; bool ignoreConfig;
string[] importPaths; string[] importPaths;
LogLevel level = globalLogLevel; LogLevel level = globalLogLevel;
version(Windows)
{
bool useTCP = true;
string socketFile;
}
else
{
bool useTCP = false;
string socketFile = generateSocketName();
}
try try
{ {
getopt(args, "port|p", &port, "I", &importPaths, "help|h", &help, getopt(args, "port|p", &port, "I", &importPaths, "help|h", &help,
"version", &printVersion, "ignoreConfig", &ignoreConfig, "version", &printVersion, "ignoreConfig", &ignoreConfig,
"logLevel", &level); "logLevel", &level, "tcp", &useTCP, "socketFile", &socketFile);
} }
catch (ConvException e) catch (ConvException e)
{ {
@ -73,11 +86,6 @@ int main(string[] args)
return 1; return 1;
} }
globalLogLevel = level;
info("Starting up...");
StopWatch sw = StopWatch(AutoStart.yes);
if (printVersion) if (printVersion)
{ {
version (Windows) version (Windows)
@ -95,19 +103,52 @@ int main(string[] args)
return 0; return 0;
} }
version (Windows) if (socketFile !is null)
{
fatal("UNIX domain sockets not supported on Windows");
return 1;
}
globalLogLevel = level;
info("Starting up...");
StopWatch sw = StopWatch(AutoStart.yes);
if (!ignoreConfig) if (!ignoreConfig)
importPaths ~= loadConfiguredImportDirs(); importPaths ~= loadConfiguredImportDirs();
auto socket = new TcpSocket(AddressFamily.INET); Socket socket;
if (useTCP)
{
socket = new TcpSocket(AddressFamily.INET);
socket.blocking = true; socket.blocking = true;
socket.setOption(SocketOptionLevel.SOCKET, SocketOption.REUSEADDR, true); socket.setOption(SocketOptionLevel.SOCKET, SocketOption.REUSEADDR, true);
socket.bind(new InternetAddress("localhost", port)); socket.bind(new InternetAddress("localhost", port));
info("Listening on port ", port);
}
else
{
socket = new Socket(AddressFamily.UNIX, SocketType.STREAM);
if (exists(socketFile))
{
info("Cleaning up old socket file at ", socketFile);
remove(socketFile);
}
socket.blocking = true;
socket.setOption(SocketOptionLevel.SOCKET, SocketOption.REUSEADDR, true);
socket.bind(new UnixAddress(socketFile));
setAttributes(socketFile, S_IRUSR | S_IWUSR);
info("Listening at ", socketFile);
}
socket.listen(0); socket.listen(0);
scope (exit) scope (exit)
{ {
info("Shutting down sockets..."); info("Shutting down sockets...");
socket.shutdown(SocketShutdown.BOTH); socket.shutdown(SocketShutdown.BOTH);
socket.close(); socket.close();
if (!useTCP)
remove(socketFile);
info("Sockets shut down."); info("Sockets shut down.");
} }
@ -126,22 +167,28 @@ int main(string[] args)
version (Posix) chdir("/"); version (Posix) chdir("/");
version (LittleEndian) version (LittleEndian)
immutable expectedClient = IPv4Union([127, 0, 0, 1]);
else
immutable expectedClient = IPv4Union([1, 0, 0, 127]); immutable expectedClient = IPv4Union([1, 0, 0, 127]);
else
immutable expectedClient = IPv4Union([127, 0, 0, 1]);
serverLoop: while (true) serverLoop: while (true)
{ {
auto s = socket.accept(); auto s = socket.accept();
s.blocking = true; s.blocking = true;
if (useTCP)
{
// Only accept connections from localhost // Only accept connections from localhost
IPv4Union actual; IPv4Union actual;
InternetAddress clientAddr = cast(InternetAddress) s.remoteAddress(); InternetAddress clientAddr = cast(InternetAddress) s.remoteAddress();
actual.i = clientAddr.addr; actual.i = clientAddr.addr;
// Shut down if somebody tries connecting from outside // Shut down if somebody tries connecting from outside
enforce(actual.i = expectedClient.i, "Connection attempted from " if (actual.i != expectedClient.i)
~ clientAddr.toAddrString()); {
fatal("Connection attempted from ", clientAddr.toAddrString());
return 1;
}
}
scope (exit) scope (exit)
{ {
@ -340,9 +387,18 @@ options:
Prints the version number and then exits. Prints the version number and then exits.
--port PORTNUMBER | -pPORTNUMBER --port PORTNUMBER | -pPORTNUMBER
Listens on PORTNUMBER instead of the default port 9166. Listens on PORTNUMBER instead of the default port 9166 when TCP sockets
are used.
--logLevel LEVEL --logLevel LEVEL
The logging level. Valid values are 'all', 'trace', 'info', 'warning', The logging level. Valid values are 'all', 'trace', 'info', 'warning',
'error', 'critical', 'fatal', and 'off'`, programName); 'error', 'critical', 'fatal', and 'off'.
--tcp
Listen on a TCP socket instead of a UNIX domain socket. This switch
has no effect on Windows.
--socketFile FILENAME
Use the given FILENAME as the path to the UNIX domain socket. Using
this switch is an error on Windows.`, programName);
} }

0
tests/actual.txt Normal file
View File

View File

@ -11,23 +11,35 @@ pass_count=0
# Make sure that the server is shut down # Make sure that the server is shut down
echo "Shutting down currently-running server..." echo "Shutting down currently-running server..."
../bin/dcd-client --shutdown 2>/dev/null > /dev/null ../bin/dcd-client --shutdown 2>/dev/null > /dev/null
../bin/dcd-client --shutdown --tcp 2>/dev/null > /dev/null
sleep 1s; sleep 1s;
for socket in unix tcp; do
echo "Running tests for $socket sockets"
# Start up the server # Start up the server
echo "Starting server..." echo "Starting server..."
if [[ $socket == "unix" ]]; then
../bin/dcd-server --ignoreConfig -I $IMPORTS 2>stderr.txt > stdout.txt & ../bin/dcd-server --ignoreConfig -I $IMPORTS 2>stderr.txt > stdout.txt &
else
../bin/dcd-server --tcp --ignoreConfig -I $IMPORTS 2>stderr.txt > stdout.txt &
fi
sleep 1s; sleep 1s;
# Run tests # Run tests
for testCase in tc*; do for testCase in tc*; do
cd $testCase; cd $testCase
./run.sh; if [[ $socket == "unix" ]]; then
if [ $? -eq 0 ]; then ./run.sh ""
echo -e "${YELLOW}$testCase:${NORMAL} ... ${GREEN}Pass${NORMAL}"; else
./run.sh "--tcp"
fi
if [[ $? -eq 0 ]]; then
echo -e "${YELLOW}$socket:$testCase:${NORMAL} ... ${GREEN}Pass${NORMAL}";
let pass_count=pass_count+1 let pass_count=pass_count+1
else else
echo -e "${YELLOW}$testCase:${NORMAL} ... ${RED}Fail${NORMAL}"; echo -e "${YELLOW}$socket:$testCase:${NORMAL} ... ${RED}Fail${NORMAL}";
let fail_count=fail_count+1 let fail_count=fail_count+1
fi fi
@ -36,10 +48,15 @@ done
# Shut down # Shut down
echo "Shutting down server..." echo "Shutting down server..."
if [[ $socket == "unix" ]]; then
../bin/dcd-client --shutdown 2>/dev/null > /dev/null ../bin/dcd-client --shutdown 2>/dev/null > /dev/null
else
../bin/dcd-client --shutdown --tcp 2>/dev/null > /dev/null
fi
done
# Report # Report
if [ $fail_count -eq 0 ]; then if [[ $fail_count -eq 0 ]]; then
echo -e "${GREEN}${pass_count} tests passed and ${fail_count} failed.${NORMAL}" echo -e "${GREEN}${pass_count} tests passed and ${fail_count} failed.${NORMAL}"
else else
echo -e "${RED}${pass_count} tests passed and ${fail_count} failed.${NORMAL}" echo -e "${RED}${pass_count} tests passed and ${fail_count} failed.${NORMAL}"

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c12 > actual.txt ../../bin/dcd-client $1 file.d -c12 > actual.txt
diff actual.txt expected.txt diff actual.txt expected.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c52 > actual.txt ../../bin/dcd-client $1 file.d -c52 > actual.txt
diff actual.txt expected.txt diff actual.txt expected.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c839 > actual1.txt ../../bin/dcd-client $1 file.d -c839 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c862 > actual2.txt ../../bin/dcd-client $1 file.d -c862 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c13 > actual.txt ../../bin/dcd-client $1 file.d -c13 > actual.txt
diff actual.txt expected.txt diff actual.txt expected.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c154 > actual.txt ../../bin/dcd-client $1 file.d -c154 > actual.txt
diff actual.txt expected.txt diff actual.txt expected.txt

View File

@ -1,14 +1,14 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c184 > actual1.txt ../../bin/dcd-client $1 file.d -c184 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c199 > actual2.txt ../../bin/dcd-client $1 file.d -c199 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt
../../bin/dcd-client file.d -c216 > actual3.txt ../../bin/dcd-client $1 file.d -c216 > actual3.txt
diff actual3.txt expected3.txt diff actual3.txt expected3.txt
../../bin/dcd-client file.d -c231 > actual4.txt ../../bin/dcd-client $1 file.d -c231 > actual4.txt
diff actual4.txt expected4.txt diff actual4.txt expected4.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c97 > actual1.txt ../../bin/dcd-client $1 file.d -c97 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c130 > actual2.txt ../../bin/dcd-client $1 file.d -c130 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c113 > actual1.txt ../../bin/dcd-client $1 file.d -c113 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt

View File

@ -1,11 +1,11 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c83 > actual1.txt ../../bin/dcd-client $1 file.d -c83 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c93 > actual2.txt ../../bin/dcd-client $1 file.d -c93 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt
../../bin/dcd-client file.d -c148 > actual3.txt ../../bin/dcd-client $1 file.d -c148 > actual3.txt
diff actual3.txt expected3.txt diff actual3.txt expected3.txt

View File

@ -6,12 +6,12 @@ cp testfile1_old.d ../imports/testfile1.d
# than one second # than one second
sleep 1s; sleep 1s;
../../bin/dcd-client file.d -c84 > actual1.txt ../../bin/dcd-client $1 file.d -c84 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
cp testfile1_new.d ../imports/testfile1.d cp testfile1_new.d ../imports/testfile1.d
# Same here # Same here
sleep 1s; sleep 1s;
../../bin/dcd-client file.d -c84 > actual2.txt ../../bin/dcd-client $1 file.d -c84 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c48 > actual1.txt ../../bin/dcd-client $1 file.d -c48 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c35 > actual1.txt ../../bin/dcd-client $1 file.d -c35 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c61 > actual2.txt ../../bin/dcd-client $1 file.d -c61 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c187 > actual1.txt ../../bin/dcd-client $1 file.d -c187 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c211 > actual2.txt ../../bin/dcd-client $1 file.d -c211 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -6,12 +6,12 @@ cp testfile2_old.d ../imports/testfile2.d
# than one second # than one second
sleep 1s; sleep 1s;
../../bin/dcd-client file.d -c39 > actual1.txt ../../bin/dcd-client $1 file.d -c39 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
cp testfile2_new.d ../imports/testfile2.d cp testfile2_new.d ../imports/testfile2.d
# Same here # Same here
sleep 1s; sleep 1s;
../../bin/dcd-client file.d -c39 > actual2.txt ../../bin/dcd-client $1 file.d -c39 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file1.d -c84 > actual1.txt ../../bin/dcd-client $1 file1.d -c84 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file2.d -c73 > actual2.txt ../../bin/dcd-client $1 file2.d -c73 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c24 > actual1.txt ../../bin/dcd-client $1 file.d -c24 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c57 > actual2.txt ../../bin/dcd-client $1 file.d -c57 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c33 > actual.txt ../../bin/dcd-client $1 file.d -c33 > actual.txt
diff actual.txt expected.txt diff actual.txt expected.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c61 > actual1.txt ../../bin/dcd-client $1 file.d -c61 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c88 > actual2.txt ../../bin/dcd-client $1 file.d -c88 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c84 > actual1.txt ../../bin/dcd-client $1 file.d -c84 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c111 > actual2.txt ../../bin/dcd-client $1 file.d -c111 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c159 > actual1.txt ../../bin/dcd-client $1 file.d -c159 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c199 > actual2.txt ../../bin/dcd-client $1 file.d -c199 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c1 > actual.txt ../../bin/dcd-client $1 file.d -c1 > actual.txt
diff actual.txt expected.txt diff actual.txt expected.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c16 > actual.txt ../../bin/dcd-client $1 file.d -c16 > actual.txt
diff actual.txt expected.txt diff actual.txt expected.txt

View File

@ -1,8 +1,8 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c117 > actual1.txt ../../bin/dcd-client $1 file.d -c117 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c89 > actual2.txt ../../bin/dcd-client $1 file.d -c89 > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt

View File

@ -1,23 +1,23 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c286 -d > actual1.txt ../../bin/dcd-client $1 file.d -c286 -d > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt
../../bin/dcd-client file.d -c290 -d > actual2.txt ../../bin/dcd-client $1 file.d -c290 -d > actual2.txt
diff actual2.txt expected2.txt diff actual2.txt expected2.txt
../../bin/dcd-client file.d -c294 -d > actual3.txt ../../bin/dcd-client $1 file.d -c294 -d > actual3.txt
diff actual3.txt expected3.txt diff actual3.txt expected3.txt
../../bin/dcd-client file.d -c298 -d> actual4.txt ../../bin/dcd-client $1 file.d -c298 -d> actual4.txt
diff actual4.txt expected4.txt diff actual4.txt expected4.txt
../../bin/dcd-client file.d -c302 -d> actual5.txt ../../bin/dcd-client $1 file.d -c302 -d> actual5.txt
diff actual5.txt expected5.txt diff actual5.txt expected5.txt
../../bin/dcd-client file.d -c306 -d> actual6.txt ../../bin/dcd-client $1 file.d -c306 -d> actual6.txt
diff actual6.txt expected6.txt diff actual6.txt expected6.txt
../../bin/dcd-client file.d -c313 -d> actual7.txt ../../bin/dcd-client $1 file.d -c313 -d> actual7.txt
diff actual7.txt expected7.txt diff actual7.txt expected7.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c94 > actual1.txt ../../bin/dcd-client $1 file.d -c94 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt

View File

@ -1,5 +1,5 @@
set -e set -e
set -u set -u
../../bin/dcd-client file.d -c53 > actual1.txt ../../bin/dcd-client $1 file.d -c53 > actual1.txt
diff actual1.txt expected1.txt diff actual1.txt expected1.txt