mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Add tests for patroni API. Fix test failures when an already running etcd is used.
21 lines
1.1 KiB
Gherkin
21 lines
1.1 KiB
Gherkin
Feature: patroni api
|
|
We should check that patroni correctly responds to valid and not-valid API requests.
|
|
|
|
Scenario: check API requests on a stand-alone server
|
|
Given I start postgres0
|
|
And postgres0 is a leader after 10 seconds
|
|
When I issue a GET request to http://127.0.0.1:8008/
|
|
Then I receive a response code 200
|
|
And I receive a response state running
|
|
And I receive a response role master
|
|
When I issue a GET request to http://127.0.0.1:8008/replica
|
|
Then I receive a response code 503
|
|
When I issue an empty POST request to http://127.0.0.1:8008/reinitialize
|
|
Then I receive a response code 503
|
|
And I receive a response text "I am the leader, can not reinitialize"
|
|
When I issue a POST request to http://127.0.0.1:8008/failover with leader=postgres0
|
|
Then I receive a response code 503
|
|
And I receive a response text "failover is not possible: cluster does not have members except leader"
|
|
When I issue an empty POST request to http://127.0.0.1:8008/failover
|
|
Then I receive a response code 503
|
|
And I receive a response text "No values given for required parameters leader and member" |