Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Skip ssl check#149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
demonolock wants to merge15 commits intomasterfromskip-ssl-check
Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
15 commits
Select commitHold shift + click to select a range
1b10a54
Add ability to skip ssl when connect to PostgresNode
Nov 1, 2024
104a127
Don't reserve a new port if port was set up
Nov 1, 2024
19ef23f
Fix flake8 style
Nov 18, 2024
43c91c0
Fix test_the_same_port
Nov 18, 2024
1e8d912
Fix failed test_ports_management
Nov 18, 2024
f1d28b4
Add env variable TESTGRES_SKIP_SSL
Nov 18, 2024
e729c2f
Fix sys.modules instead globals
Nov 18, 2024
dc4b4c3
Move _get_ssl_options in separate function
Nov 18, 2024
547081e
Merge branch 'master' into skip-ssl-check
dmitry-lipetskDec 4, 2024
fb6205d
Merge branch 'master' into skip-ssl-check
dmitry-lipetskDec 6, 2024
67f23a7
Merge branch 'master' into skip-ssl-check
dmitry-lipetskDec 8, 2024
b67ae42
Merge branch 'master' into skip-ssl-check
dmitry-lipetskDec 10, 2024
be972e0
Merge branch 'master' into skip-ssl-check
dmitry-lipetskDec 10, 2024
0781132
Merge branch 'master' into skip-ssl-check
dmitry-lipetskDec 10, 2024
fa6d751
[BUG FIX] TestgresRemoteTests.test_safe_psql__expect_error is corrected
dmitry-lipetskDec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Move _get_ssl_options in separate function
  • Loading branch information
vshepard committedDec 3, 2024
commitdc4b4c3dbf26e1d019b7fe0395a2fb8f933b0c38
15 changes: 13 additions & 2 deletionstestgres/operations/os_ops.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,16 +124,27 @@ def get_pid(self):
def get_process_children(self, pid):
raise NotImplementedError()

def _get_ssl_options(self):
"""
Determine the SSL options based on available modules.
"""
if self.conn_params.skip_ssl:
if 'psycopg2' in sys.modules:
return {"sslmode": "disable"}
elif 'pg8000' in sys.modules:
return {"ssl_context": None}
return {}

# Database control
def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
ssl_options ={"sslmode": "disable"} ifself.conn_params.skip_ssl and 'psycopg2' in sys.modules else {}
ssl_options = self._get_ssl_options()
conn = pglib.connect(
host=host,
port=port,
database=dbname,
user=user,
password=password,
**({"ssl_context": None} if self.conn_params.skip_ssl and 'pg8000' in sys.modules elsessl_options)
**ssl_options
)

return conn
8 changes: 5 additions & 3 deletionstests/test_simple.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1039,9 +1039,11 @@ def test_parse_pg_version(self):
def test_the_same_port(self):
with get_new_node() as node:
node.init().start()
with get_new_node() as node2:
node2.port = node.port
node2.init().start()
with get_new_node() as node2:
node2.port = node.port
# _should_free_port is true if port was set up manually
node2._should_free_port = False
node2.init().start()

def test_make_simple_with_bin_dir(self):
with get_new_node() as node:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp