Map new SQL users to explicitly selected existing Linux accounts

This commit is contained in:
2026-12-01 12:41:25 +00:00
parent b131dcc9d6
commit 53e6c27960
12 changed files with 166 additions and 12 deletions

View File

@@ -24,8 +24,9 @@ def fixture(source,path,body):
if path=='/api/identities':
if body:
assert body['confirm'] and body['name']=='ALICE' and len(body['password'])==20
created+=1;objects.append({'name':'ALICE','type':1,'unix':'marsv200000000','id':3,'disabled':False});return {'alias':'marsv200000000','uid':200000000}
return dict(wrappedBindery=True,liveComplete=True,databaseAvailable=True,identities=[{'name':'ALICE','alias':'marsv200000000','uid':200000000,'status':'linked'}] if created else [],issues=[])
assert body['unix']=='chris' and body['uid']==1000 and body['gid']==1000 and body['sharedConfirmed']
created+=1;objects.append({'name':'ALICE','type':1,'unix':'chris','id':3,'disabled':False});return {'alias':'chris','unix':'chris','uid':1000}
return dict(localUsers=[{'name':'chris','uid':1000,'gid':1000}],localMappings=[],wrappedBindery=True,liveComplete=True,databaseAvailable=True,identities=[{'name':'ALICE','alias':'marsv200000000','uid':200000000,'status':'linked'}] if created else [],issues=[])
if path=='/api/bindery' and body['op']=='objects':return {'objects':objects}
raise AssertionError((path,body))
with sync_playwright() as p:
@@ -38,7 +39,7 @@ with sync_playwright() as p:
page.locator('#directoryNext').click();page.locator('#directoryTree').fill('INVALID NAME');page.locator('#directoryNext').click();assert 'zulässige' in page.locator('#directoryMessage').inner_text();page.locator('#directoryTree').fill('MARS_TREE');page.locator('#directoryNext').click();page.locator('#directoryAuto').click();page.locator('#directoryNext').click();assert 'Tree / Baum: leer lassen' in page.locator('#directoryClient').input_value();page.locator('#directorySave').click();page.wait_for_function("document.getElementById('directoryMessage').textContent.includes('gespeichert')");assert config['placements']
# A failed reload must not permit a save of stale data.
fail=True;page.locator('#directoryBack').click();page.locator('#directoryBack').click();page.locator('#directoryBack').click();page.locator('#directoryReload').click();page.wait_for_function("document.getElementById('directoryMessage').textContent.includes('Bitte erneut laden')");assert page.locator('#directoryNext').is_disabled();fail=False;page.locator('#directoryReload').click();page.wait_for_function("!document.getElementById('directoryNext').disabled");page.locator('#directoryBindery').click();page.wait_for_function("document.getElementById('bindSummary').textContent.includes('2 Objekte')")
page.locator('#createUser').click();page.locator('[name=name]').fill('alice');page.get_by_role('button',name='Sicheres Kennwort erzeugen').click();pw=page.locator('[name=password]').input_value();assert len(pw)==20 and all(c in '0123456789ABCDEF' for c in pw);page.locator('#actionSubmit').click();page.wait_for_function("document.getElementById('bindSummary').textContent.includes('3 Objekte')");assert created==1;assert page.locator('[name=password]').input_value()==''
page.locator('#createUser').click();page.locator('[name=name]').fill('alice');assert page.locator('[name=unix]').input_value()=='';page.locator('[name=unix]').select_option('chris');page.get_by_role('button',name='Sicheres Kennwort erzeugen').click();pw=page.locator('[name=password]').input_value();assert len(pw)==20 and all(c in '0123456789ABCDEF' for c in pw);page.locator('#actionSubmit').click();page.wait_for_function("document.getElementById('bindSummary').textContent.includes('3 Objekte')");assert created==1;assert page.locator('[name=password]').input_value()==''
page.evaluate("()=>document.querySelectorAll('dialog[open]').forEach(d=>d.close())")
page.locator('#ncpIpOpen').click();page.wait_for_function("!document.getElementById('ncpPresetIp').disabled")
page.locator('#ncpPresetIp').click();assert page.locator('#ncpIpEnabled').is_checked();assert page.locator('#ncpIpSlp').is_checked();assert page.locator('#ncpIpRestart').is_disabled()