Use random password instead of hard coded password as a security measure.
This commit is contained in:
parent
4ed95aad94
commit
fb445815f2
@ -13,6 +13,7 @@ import TestEnv
|
|||||||
|
|
||||||
import cx_Oracle
|
import cx_Oracle
|
||||||
import random
|
import random
|
||||||
|
import string
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
class TestCase(TestEnv.BaseTestCase):
|
class TestCase(TestEnv.BaseTestCase):
|
||||||
@ -127,7 +128,9 @@ class TestCase(TestEnv.BaseTestCase):
|
|||||||
|
|
||||||
def testChangePassword(self):
|
def testChangePassword(self):
|
||||||
"test changing password"
|
"test changing password"
|
||||||
newPassword = "NEW_PASSWORD"
|
sysRandom = random.SystemRandom()
|
||||||
|
newPassword = "".join(sysRandom.choice(string.ascii_letters) \
|
||||||
|
for i in range(20))
|
||||||
connection = TestEnv.GetConnection()
|
connection = TestEnv.GetConnection()
|
||||||
connection.changepassword(TestEnv.GetMainPassword(), newPassword)
|
connection.changepassword(TestEnv.GetMainPassword(), newPassword)
|
||||||
cconnection = cx_Oracle.connect(TestEnv.GetMainUser(), newPassword,
|
cconnection = cx_Oracle.connect(TestEnv.GetMainUser(), newPassword,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user