Skip to content

Commit d86778d

Browse files
committed
fix auth_test
fix file mode
1 parent 2526797 commit d86778d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/auth_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def run_pb_with_auth(self, password=None, kill=False):
186186
except ExceptionPexpect:
187187
raise ExceptionPexpect("Pexpect error.")
188188

189+
189190
def modify_pg_hba(node):
190191
"""
191192
Description:
@@ -199,7 +200,9 @@ def modify_pg_hba(node):
199200
fio.seek(0)
200201
fio.write('host\tall\tpostgres\t127.0.0.1/0\ttrust\n' + data)
201202

203+
202204
def create_pgpass(path, line):
203-
with open(path, 'w', mode='0660') as passfile:
205+
with open(path, 'w') as passfile:
204206
# host:port:db:username:password
205-
passfile.write(line)
207+
passfile.write(line)
208+
os.chmod(path, 600)

0 commit comments

Comments
 (0)