1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00

45 Commits

Author SHA1 Message Date
Vishal Pandey
dfb24628dc Improve brick mux e2e test suite. Handle cases causing spurious failures
in brickmux tests. Increase waiting time for bricks to sign in and
add sleep whereever a new gd2 instance is respawned to give enough time
to bricks to sign in properly and multiplex.

Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2019-01-10 20:07:49 +05:30
rishubhjain
8a52b23d84 Replace brick api 2018-12-07 19:04:19 +05:30
Prashanth Pai
9db04c1a1b e2e: Add logs to code that spawns glusterd2
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-09-17 17:45:31 +05:30
Prashanth Pai
936f040f10 e2e: Create separate localstatedirs for each test
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-09-17 17:45:31 +05:30
Prashanth Pai
33b55087eb e2e: Return error if auth secret file cannot be read
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-09-07 16:16:23 +05:30
Prashanth Pai
9babdf1037 Use syscall to unmount instead of spawning a process
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-09-07 16:16:23 +05:30
Vishal Pandey
9b9ad781a5 Implement Granular-entry-heal enable/disable using volume set
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-09-06 15:43:32 +05:30
Prashanth Pai
37f85837c6 Try force unmounting in e2e tests
...and add log so that we can see what's being unmounted.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-09-04 11:35:05 +05:30
Prashanth Pai
fd484f91b9 e2e: test fuse mount after mounting
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-08-27 10:31:03 +05:30
Prashanth Pai
ea14569fb2 Use glusterfs binary to mount
..as mount.glusterfs utility might be installed in non-standard
location in test environments.

Besides, mounts in real code (volume status) already uses the binary
to mount and not the mount utility script.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-08-27 10:31:03 +05:30
Aravinda VK
1a9d78c8b7 Delete bricks on Volume delete if bricks are auto provisioned
On Volume delete,

- Unmount the Brick if mounted
- Remove LV
- Remove Thinpool if number of Lvs in the thinpool is zero

Fixes: #938
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-08-21 20:01:06 +05:30
Oshank Kumar
38d20ee280 restclient: refactor some of the rest client code .
added separate method to create http.Request.
Initializing underlying http.Client while initializing
GlusterD rest client

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2018-08-14 18:28:18 +05:30
John Mulligan
dfa934a7e3 e2e: optionally start and manage etcd external to glusterd2
This change establishes the ability for the e2e tests to
start an etcd instance that all glusterd2 instances under
test will use, but that is not managed by glusterd2's
internal elastic etcd feature.

A new flag and corresponding global is established to control
whether the glusterd2 instances should use the internal,
elastic etcd, mode or if they should rely on an externally
deployed etcd instance. The flag -external-etcd is used to
control whether the testCluster instance will start up etcd
and have glusterd2 use it or not.

Note that this etcd instance is still internal to the test suite
and the tests should only require an etcd binary on the path.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2018-07-13 10:56:50 +05:30
John Mulligan
bab15926c0 e2e: create a testCluster type
The system is going to grow more services that need management.
Instead of passing a gds array around pass a higher level
testCluster type

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2018-07-13 10:56:50 +05:30
John Mulligan
1d2cf13a44 e2e: split process management into a new file
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2018-07-13 10:56:50 +05:30
Madhu Rajanna
b83184c462 e2e cleanup
instead of passing LocalStateDir and ClientAddress
of gdProcess to initRestClient function,
pass gdProcess object to initRestClient

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-07-10 15:58:09 +05:30
Madhu Rajanna
0190411220 Enable Rest Authentication by default
if a restauth key is missing in config
file or if restauth is set to true,
glusterd2 will do token authentication.

Authentication can be disabled by
by setting restauth key in the configuration
to false.

updated test cases to use authentication
if auth file is present

added default rest authentication in glustercli

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-07-10 13:52:48 +05:30
Prashanth Pai
c3a53936b0 e2e: Ensure setupCluster() returns error on failure
Also:
* Make setupCluster() use the restclient to do peer operations
* Bump up default wait time to check if gd2 is alive from 1.5s to 2s
* Ensure cleanup happens in all failure cases

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-09 15:12:33 +05:30
John Mulligan
35ec52b6a8 e2e: establish a common approach to creating per-test temp dirs
Add a helper function for tests that need unique test dirs that
creates test directories like /[base]/[testname]/[unique].

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2018-07-09 09:36:47 +05:30
Hari Gowtham
806a203695 quota: disable quotad
quota enable and disable as a volume set option
The daemon start and stop are called using the actor
framework.

Updates: #421
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
2018-07-04 12:37:40 +05:30
Prashanth Pai
dd2a8f7507 Remove 'workdir' config in favour of 'localstatedir'
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>
2018-07-02 09:44:30 +05:30
Madhu Rajanna
8b92ea790c e2e test: use testcase Name as volume name
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-25 13:45:03 +05:30
Prashanth Pai
368541a8b8 e2e: Remove duplicate call to cleanupAllGlusterPvs()
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-06-13 17:18:53 +05:30
Prashanth Pai
94c00ec88d e2e: Fix localstatedir having relative path
The localstatedir from config file contained relative path which was
not being converted to absolute path before passing as command line
argument to glusterd2.

Unexported UpdateDirs() as it was only used internally.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-06-13 17:17:31 +05:30
Prashanth Pai
fcbe9ac877 Set request ID, peer ID and cluster ID in middleware
...and not in SendHTTPError(). This will ensure that these response
headers are always sent to client in all responses.

Earlier, for APIs such as /statedump, the headers were not sent in
response as it's handler did not have to invoke any restutils.*
functions.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-06-06 18:16:50 +05:30
Aravinda VK
45d8d420b4 Intelligent Volume Provisioning
Updates: #466
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-05-31 19:42:40 +05:30
John Mulligan
e3b273ddd3 e2e: don't delete workdir when tearing down
Deleting the workdir when tearing down deletes the logs and
other evidence needed to debug failing tests. The e2e main
function already deletes the top-level working dir at the
start of the tests and we recently added the ability to
use custom workdirs for different test runs.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2018-04-26 14:44:45 -04:00
John Mulligan
9e9baeee5e e2e: make a central, configurable, base workdir
Previously, e2e tests were hard-coding the base workdir in
the main_test.go file and in the config toml files. This change
centralizes the base path in a top-level variable and makes
it possible to specify custom values for the workdir. This
can be useful if /tmp is inappropriate for this task on a
particular system or if multiple e2e tests are to be run in
parallel so that the caller may specify unique paths for
each test.
The toml files are adjusted to contain relative paths.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2018-04-24 16:47:10 -04:00
Prashanth Pai
729ab0be34 e2e: Minor fixes
* Bumped up sleep at two places hoping that it'll reduce chances of
  failure. Elastic etcd almost never works reliably on my machine :(
* Tear down cluster will now kill daemons spawned by glusterd2.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-04-23 09:40:10 +05:30
Aravinda VK
ae0fe1b65a Default configuration for glusterd2 when run using systemctl
systemctl enable glusterd2
    systemctl start glusterd2
    systemctl status glusterd2

Limited config file extension to `TOML` to avoid confusions with
multiple config extensions.

Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-02-27 12:39:33 +05:30
Kaushal M
afcb0c5229 Remove templatesdir from e2e 2018-01-12 16:29:55 +05:30
Prashanth Pai
2dd8c0daf0 Serve RPCs over Unix domain socket
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-12-22 12:00:22 +05:30
Prashanth Pai
c2394a016f Fix tests
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-11-30 18:26:34 +05:30
Aravinda VK
76b710e9e4 restapi/auth: Fixed IsRESTServer running function
Updates: #252
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2017-11-08 17:22:11 +05:30
Aravinda VK
f9c851ec26 rest: Authentication middleware
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>
2017-11-08 17:22:11 +05:30
Kaushal M
de398a992a Merge remote-tracking branch 'origin/master' into volgen-2.0 2017-10-11 17:58:45 +05:30
Prashanth Pai
f752b8b88b cli: Add SSL/TLS support
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-10-10 22:16:42 +05:30
Kaushal M
63f19075f3 Fix e2e tests for templates and update centos-ci.sh 2017-10-10 20:00:10 +05:30
Aravinda VK
61ee3e382c restclient: Modified e2e tests to use restclient
Updates: #265
Signed-off-by: Aravinda VK <mail@aravindavk.in>
2017-08-11 12:41:14 +05:30
Aravinda VK
b618f9d222 restclient: Golang REST Client library
REST Client for Glusterd2 APIs. Initially these APIs will be used by
CLI project, it can be used by any application which is written in Go
lang.

Example:

    package main

    import (
        "fmt"
        "github.com/gluster/glusterd2/pkg/restclient"
    )

    func main(){
        client := restclient.NewRESTClient("http://localhost:24007", "", "")
        err := client.VolumeStart("gv1")
        if err != nil{
                fmt.Println("Failed to Start Volume gv1")
        } else{
                fmt.Println("Started Volume gv1 successfully")
        }
    }

Signed-off-by: Aravinda VK mail@aravindavk.in
Updates: #265
2017-08-10 15:12:37 +05:30
Kaushal M
d80a97feb2 e2e: Add restart test 2017-08-01 15:17:06 +05:30
Prashanth Pai
86590e1097 Fix panics during functest
I assumed assert() will exit the test, but it's require() that exits
the test being run when the condition being tested is false.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-06-28 18:16:11 +05:30
Prashanth Pai
18158e5188 Introduce volume ops functional tests
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-06-13 11:40:28 +05:30
Prashanth Pai
264ef1a5ea Reduce sleep time on spawn
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-06-13 10:30:37 +05:30
Prashanth Pai
d11033c505 Rename func_test package to e2e
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-05-24 14:17:29 +05:30