This test didn't really need a lot of manual control over it's
glusterd2 instances. Switch it to use the test cluster functions.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
For all practical purposes, in real usage and in tests, the configurable
paths `workdir` and `localstatedir` are set to the same directory which
defaults to `/var/lib/glusterd2` or `/user/local/var/lib/glusterd2`
Unlike glusterd1, glusterd2 does not daemonize itself. The working
directory of the process can be meaningfully set to either current
working directory from where glusterd2 process is started or to
`localstatedir` where glusterd2 stores all its data. We choose the
latter.
This change also reduces ambiguity for users and one less thing to
configure.
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Avoid deleting the glusterd2 workdirs within the test bodies.
This will allow for post-test debugging. These dirs will be
cleaned up by the start of the next test(s) or by external
code.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Added REST API authentication middleware. On Glusterd2 start, it
generates `$WORKDIR/auth` file with random string if not exists.
Local CLI/Curl can use that auth file and add Authorization request.
Note: User management is not covered in this patch. Limited to local
consumers only who can access `$WORKDIR/auth`. Auth is disabled by
default which can be enabled using config file option `restauth=true`
CLI needs new flag `--auth-file` to accept path for auth file similar
to Glusterd1 CLI flag `glusterd-sock`
Updates: #252
Signed-off-by: Aravinda VK <avishwan@redhat.com>