mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 09:13:58 +00:00
ssh tunnel test disabled
This commit is contained in:
@@ -23,9 +23,48 @@ describe('Initialization', () => {
|
|||||||
cy.contains('performance_schema');
|
cy.contains('performance_schema');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// it('SSH connection', () => {
|
||||||
|
// const runOnCI = Cypress.env('runOnCI');
|
||||||
|
|
||||||
|
// cy.get('body')
|
||||||
|
// .trigger('keydown', {
|
||||||
|
// key: 'F1',
|
||||||
|
// code: 'F1',
|
||||||
|
// which: 112,
|
||||||
|
// keyCode: 112,
|
||||||
|
// bubbles: true,
|
||||||
|
// })
|
||||||
|
// .trigger('keyup', {
|
||||||
|
// key: 'F1',
|
||||||
|
// code: 'F1',
|
||||||
|
// which: 112,
|
||||||
|
// keyCode: 112,
|
||||||
|
// bubbles: true,
|
||||||
|
// });
|
||||||
|
// cy.get('body').type('Close all');
|
||||||
|
// cy.get('body').type('{enter}');
|
||||||
|
|
||||||
|
// cy.visit('http://localhost:3000');
|
||||||
|
// cy.get('[data-testid=ConnectionList_buttonNewConnection]').click();
|
||||||
|
// cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL');
|
||||||
|
// cy.get('[data-testid=ConnectionDriverFields_user]').clear().type('root');
|
||||||
|
// cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('root');
|
||||||
|
|
||||||
|
// cy.get('[data-testid=ConnectionSshTunnelFields_sshLogin]').clear().type('root');
|
||||||
|
// cy.get('[data-testid=ConnectionSshTunnelFields_sshPassword]').clear().type('root');
|
||||||
|
// if (runOnCI) {
|
||||||
|
// cy.get('[data-testid=ConnectionSshTunnelFields_sshHost]').clear().type('mysql-ssh');
|
||||||
|
// } else {
|
||||||
|
// cy.get('[data-testid=ConnectionSshTunnelFields_sshPort]').clear().type('16006');
|
||||||
|
// }
|
||||||
|
// cy.get('[data-testid=ConnectionDriverFields_displayName]').clear().type('test-mysql-ssh-1');
|
||||||
|
// cy.get('[data-testid=ConnectionTab_buttonSave]').click();
|
||||||
|
// cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
||||||
|
// cy.contains('performance_schema');
|
||||||
|
// });
|
||||||
|
|
||||||
// it('import chinook DB', () => {
|
// it('import chinook DB', () => {
|
||||||
// cy.visit('http://localhost:3000');
|
// cy.visit('http://localhost:3000');
|
||||||
// cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
// cy.get('[data-testid=ConnectionTab_buttonConnect]').click();
|
||||||
// });
|
// });
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,3 +16,10 @@ services:
|
|||||||
- 16004:3306
|
- 16004:3306
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=Pwd2020Db
|
- MYSQL_ROOT_PASSWORD=Pwd2020Db
|
||||||
|
|
||||||
|
mysql-ssh:
|
||||||
|
build: mysql-ssh
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 16005:3306
|
||||||
|
- 16006:22
|
||||||
|
|||||||
22
e2e-tests/mysql-ssh/Dockerfile
Normal file
22
e2e-tests/mysql-ssh/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y openssh-server mysql-server && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN mkdir /var/run/sshd
|
||||||
|
|
||||||
|
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||||
|
RUN echo 'root:root' | chpasswd
|
||||||
|
|
||||||
|
RUN service mysql start && \
|
||||||
|
mysql -uroot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; FLUSH PRIVILEGES;" && \
|
||||||
|
service mysql stop
|
||||||
|
|
||||||
|
EXPOSE 22 3306
|
||||||
|
|
||||||
|
COPY start.sh /start.sh
|
||||||
|
RUN chmod +x /start.sh
|
||||||
|
|
||||||
|
CMD ["/start.sh"]
|
||||||
7
e2e-tests/mysql-ssh/start.sh
Normal file
7
e2e-tests/mysql-ssh/start.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
service ssh start
|
||||||
|
|
||||||
|
service mysql start
|
||||||
|
|
||||||
|
tail -f /dev/null
|
||||||
@@ -28,7 +28,12 @@
|
|||||||
$: isConnected = $openedConnections.includes($values._id) || $openedSingleDatabaseConnections.includes($values._id);
|
$: isConnected = $openedConnections.includes($values._id) || $openedSingleDatabaseConnections.includes($values._id);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<FormCheckboxField label="Use SSH tunnel" name="useSshTunnel" disabled={isConnected} />
|
<FormCheckboxField
|
||||||
|
label="Use SSH tunnel"
|
||||||
|
name="useSshTunnel"
|
||||||
|
disabled={isConnected}
|
||||||
|
data-testid="ConnectionSshTunnelFields_useSshTunnel"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-9 mr-1">
|
<div class="col-9 mr-1">
|
||||||
@@ -37,6 +42,7 @@
|
|||||||
name="sshHost"
|
name="sshHost"
|
||||||
disabled={isConnected || !useSshTunnel}
|
disabled={isConnected || !useSshTunnel}
|
||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshHost"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
@@ -46,6 +52,7 @@
|
|||||||
disabled={isConnected || !useSshTunnel}
|
disabled={isConnected || !useSshTunnel}
|
||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
placeholder="22"
|
placeholder="22"
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshPort"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,10 +69,16 @@
|
|||||||
{ value: 'agent', label: 'SSH agent' },
|
{ value: 'agent', label: 'SSH agent' },
|
||||||
{ value: 'keyFile', label: 'Key file' },
|
{ value: 'keyFile', label: 'Key file' },
|
||||||
]}
|
]}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshMode"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{#if ($values.sshMode || 'userPassword') != 'userPassword'}
|
{#if ($values.sshMode || 'userPassword') != 'userPassword'}
|
||||||
<FormTextField label="Login" name="sshLogin" disabled={isConnected || !useSshTunnel} />
|
<FormTextField
|
||||||
|
label="Login"
|
||||||
|
name="sshLogin"
|
||||||
|
disabled={isConnected || !useSshTunnel}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshLogin"
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if ($values.sshMode || 'userPassword') == 'userPassword'}
|
{#if ($values.sshMode || 'userPassword') == 'userPassword'}
|
||||||
@@ -76,6 +89,7 @@
|
|||||||
name="sshLogin"
|
name="sshLogin"
|
||||||
disabled={isConnected || !useSshTunnel}
|
disabled={isConnected || !useSshTunnel}
|
||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshLogin"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
@@ -84,6 +98,7 @@
|
|||||||
name="sshPassword"
|
name="sshPassword"
|
||||||
disabled={isConnected || !useSshTunnel}
|
disabled={isConnected || !useSshTunnel}
|
||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshPassword"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -99,6 +114,7 @@
|
|||||||
disabled={isConnected || !useSshTunnel}
|
disabled={isConnected || !useSshTunnel}
|
||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
defaultFileName={$platformInfo?.defaultKeyfile}
|
defaultFileName={$platformInfo?.defaultKeyfile}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshKeyfile"
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<FormTextField
|
<FormTextField
|
||||||
@@ -107,6 +123,7 @@
|
|||||||
disabled={isConnected || !useSshTunnel}
|
disabled={isConnected || !useSshTunnel}
|
||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
placeholder={$platformInfo?.defaultKeyfile}
|
placeholder={$platformInfo?.defaultKeyfile}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshKeyfile"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -116,6 +133,7 @@
|
|||||||
name="sshKeyfilePassword"
|
name="sshKeyfilePassword"
|
||||||
disabled={isConnected || !useSshTunnel}
|
disabled={isConnected || !useSshTunnel}
|
||||||
templateProps={{ noMargin: true }}
|
templateProps={{ noMargin: true }}
|
||||||
|
data-testid="ConnectionSshTunnelFields_sshKeyfilePassword"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user