|
2 | 2 |
|
3 | 3 | import pytest |
4 | 4 |
|
5 | | -from testgres import ExecUtilException |
| 5 | +from testgres import ExecUtilException, get_remote_node, testgres_config |
6 | 6 | from testgres import RemoteOperations |
7 | 7 | from testgres import ConnectionParams |
8 | 8 |
|
@@ -34,7 +34,7 @@ def test_exec_command_failure(self): |
34 | 34 | exit_status, result, error = self.operations.exec_command(cmd, verbose=True, wait_exit=True) |
35 | 35 | except ExecUtilException as e: |
36 | 36 | error = e.message |
37 | | - assert error == b'Utility exited with non-zero code. Error: bash: line 1: nonexistent_command: command not found\n' |
| 37 | + assert error == 'Utility exited with non-zero code. Error: bash: line 1: nonexistent_command: command not found\n' |
38 | 38 |
|
39 | 39 | def test_is_executable_true(self): |
40 | 40 | """ |
@@ -87,7 +87,7 @@ def test_makedirs_and_rmdirs_failure(self): |
87 | 87 | exit_status, result, error = self.operations.rmdirs(path, verbose=True) |
88 | 88 | except ExecUtilException as e: |
89 | 89 | error = e.message |
90 | | - assert error == b"Utility exited with non-zero code. Error: rm: cannot remove '/root/test_dir': Permission denied\n" |
| 90 | + assert error == "Utility exited with non-zero code. Error: rm: cannot remove '/root/test_dir': Permission denied\n" |
91 | 91 |
|
92 | 92 | def test_listdir(self): |
93 | 93 | """ |
@@ -192,3 +192,25 @@ def test_isfile_false(self): |
192 | 192 | response = self.operations.isfile(filename) |
193 | 193 |
|
194 | 194 | assert response is False |
| 195 | + |
| 196 | + def test_skip_ssl(self): |
| 197 | + conn_params = ConnectionParams(host=os.getenv('RDBMS_TESTPOOL1_HOST') or '127.0.0.1', |
| 198 | + username=os.getenv('USER'), |
| 199 | + remote=True, |
| 200 | + skip_ssl=True) |
| 201 | + os_ops = RemoteOperations(conn_params) |
| 202 | + testgres_config.set_os_ops(os_ops=os_ops) |
| 203 | + with get_remote_node().init().start() as node: |
| 204 | + with node.connect() as con: |
| 205 | + con.begin() |
| 206 | + con.execute('create table test(val int)') |
| 207 | + con.execute('insert into test values (1)') |
| 208 | + con.commit() |
| 209 | + |
| 210 | + con.begin() |
| 211 | + con.execute('insert into test values (2)') |
| 212 | + res = con.execute('select * from test order by val asc') |
| 213 | + if isinstance(res, list): |
| 214 | + res.sort() |
| 215 | + assert res == [(1,), (2,)] |
| 216 | + |
0 commit comments