Univention Bugzilla – Attachment 10359 Details for
Bug 51047
Nutzung des Self Service gestört (Errorcode 20)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
pwchange.py
pwchange.py (text/x-python), 2.31 KB, created by
Felix Botner
on 2020-05-12 12:04:58 CEST
(
hide
)
Description:
pwchange.py
Filename:
MIME Type:
Creator:
Felix Botner
Created:
2020-05-12 12:04:58 CEST
Size:
2.31 KB
patch
obsolete
>from selenium import webdriver >from selenium.webdriver.support import expected_conditions as EC >from selenium.webdriver.common.by import By >from selenium.webdriver.support.ui import WebDriverWait >from xvfbwrapper import Xvfb > >import os >import threading >import Queue >import time > >class createUser(threading.Thread): > def __init__(self, name, q, o): > threading.Thread.__init__(self) > self.q = q > self.o = o > self.setDaemon(True) > self.name = name > > def run(self): > print("run() - %s" % self.name) > while True: > data = self.q.get() > (username, old_pwd, new_pwd) = data.split(':') > print('changing pw for {} ({} -> {})'.format(username, old_pwd, new_pwd)), > try: > change_password(username, old_pwd, new_pwd) > print('done') > except Exception as e: > print('fail: {}'.format(e)) > finally: > self.q.task_done() > > >def change_password(username, old_p, new_p): > with Xvfb(): > options = webdriver.ChromeOptions() > options.add_argument('--no-sandbox') > try: > driver = webdriver.Chrome(chrome_options=options) > driver.get('http://10.200.7.160/univention/self-service/#page=passwordchange') > WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="selfservice_password_TextBox_5"]'))).send_keys(username) > WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="selfservice_password_TextBox_6"]'))).send_keys(old_p) > WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="selfservice_password_PasswordBox_2"]'))).send_keys(new_p) > WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="selfservice_password_TextBox_7"]'))).send_keys(new_p) > elem = driver.find_elements_by_id('dijit_form_Button_3_label')[0] > elem.click() > time.sleep(3) > finally: > driver.quit() > >#change_password('test1', 'univention', 'Univention.99') > >thread_number = 15 >threads = [] >q = Queue.Queue(maxsize=thread_number) >o = Queue.Queue(maxsize=0) > >for i in range(thread_number): > t = createUser("%s" % i, q, o) > t.start() > threads.append(t) > >for i in range(1, 1001): > username = 'dtest{}'.format(i) > old_pwd = '99Univention.998' > new_pwd = '99Univention.9988' > q.put('{}:{}:{}'.format(username, old_pwd, new_pwd)) > >#for line in fileinput.input(opts.input_file): ># q.put(line.strip()) > >q.join() >while not o.empty(): > print(o.get()) > >print("Exiting Main Thread")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 51047
: 10359 |
10370