Commit b13ba7f7 authored by Jérome Perrin's avatar Jérome Perrin

Repman: update golang

See merge request !925
No related merge requests found
...@@ -6,7 +6,6 @@ parts = ...@@ -6,7 +6,6 @@ parts =
gowork gowork
[gowork] [gowork]
golang = ${golang1.13:location}
install = install =
buildflags = -v --tags server --ldflags "-extldflags 'static' -w -s -X main.GoOS=linux -X main.GoArch=amd64 -X main.Version=2.1 -X main.FullVersion=$FULLVERSION -X main.Build=$(date +%FT%T%z) -X main.WithProvisioning=ON -X main.WithOpenSVC=OFF -X main.WithHaproxy=ON -X main.WithMaxscale=ON -X main.WithMariadbshardproxy=ON -X main.WithProxysql=ON -X main.WithSphinx=ON -X main.WithArbitration=OFF -X main.WithArbitrationClient=ON -X main.WithMonitoring=ON -X main.WithHttp=ON -X main.WithBackup=ON -X main.WithMail=ON -X main.WithEnforce=ON -X main.WithDeprecate=ON" buildflags = -v --tags server --ldflags "-extldflags 'static' -w -s -X main.GoOS=linux -X main.GoArch=amd64 -X main.Version=2.1 -X main.FullVersion=$FULLVERSION -X main.Build=$(date +%FT%T%z) -X main.WithProvisioning=ON -X main.WithOpenSVC=OFF -X main.WithHaproxy=ON -X main.WithMaxscale=ON -X main.WithMariadbshardproxy=ON -X main.WithProxysql=ON -X main.WithSphinx=ON -X main.WithArbitration=OFF -X main.WithArbitrationClient=ON -X main.WithMonitoring=ON -X main.WithHttp=ON -X main.WithBackup=ON -X main.WithMail=ON -X main.WithEnforce=ON -X main.WithDeprecate=ON"
......
...@@ -5,9 +5,6 @@ extends = ...@@ -5,9 +5,6 @@ extends =
parts = parts =
restic restic
[gowork]
golang = ${golang1.13:location}
[restic] [restic]
recipe = plone.recipe.command recipe = plone.recipe.command
......
...@@ -43,9 +43,6 @@ setup( ...@@ -43,9 +43,6 @@ setup(
install_requires=[ install_requires=[
'slapos.core', 'slapos.core',
'slapos.libnetworkcache', 'slapos.libnetworkcache',
'erp5.util',
'supervisor',
'pexpect',
'requests', 'requests',
], ],
zip_safe=True, zip_safe=True,
......
...@@ -24,16 +24,10 @@ ...@@ -24,16 +24,10 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
from __future__ import unicode_literals
import os import os
import textwrap from six.moves.urllib.parse import urljoin
import logging
import tempfile
import time
from six.moves.urllib.parse import urlparse, urljoin
import pexpect
import requests import requests
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -44,17 +38,46 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( ...@@ -44,17 +38,46 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
class TestRepman(SlapOSInstanceTestCase): class TestRepman(SlapOSInstanceTestCase):
__partition_reference__ = 'R' # solve path too long for postgresql and unicorn __partition_reference__ = 'R'
@classmethod
def getInstanceSoftwareType(cls):
return 'default'
def setUp(self): def setUp(self):
self.backend_url = self.computer_partition.getConnectionParameterDict( self.url = self.computer_partition.getConnectionParameterDict()['url']
)['backend-url']
def test_http_get(self): def test_http_get(self):
resp = requests.get(self.backend_url, verify=False) connection_parameter_dict = \
self.assertTrue( self.computer_partition.getConnectionParameterDict()
resp.status_code in [requests.codes.ok, requests.codes.found]) resp = requests.get(self.url, verify=False)
self.assertEqual(resp.status_code, requests.codes.ok)
resp = requests.post(
urljoin(self.url, '/api/login'),
json={
'username': connection_parameter_dict['username'],
'password': connection_parameter_dict['repman-password'],
},
verify=False,
)
self.assertEqual(resp.status_code, requests.codes.ok)
token = resp.json()['token']
headers = {"authorization": "Bearer " + token}
resp = requests.get(
urljoin(self.url, '/api/monitor'),
headers=headers,
verify=False,
)
self.assertEqual(resp.status_code, requests.codes.ok)
resp = requests.get(
urljoin(self.url, '/api/clusters'),
params={
'query': '{"method":"GET","isArray":false}',
},
headers=headers,
verify=False,
)
self.assertEqual(resp.status_code, requests.codes.ok)
cluster, = resp.json()
self.assertTrue(cluster['isProvision'])
self.assertTrue(cluster['isFailable'])
self.assertFalse(cluster['isDown'])
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