From: Tom Yu Date: Tue, 30 Aug 2011 21:30:11 +0000 (+0000) Subject: Have kinit, klist and klist_keytab in k5test.realm take keyword args X-Git-Tag: krb5-1.10-alpha1~256 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=458c1bd81c13cd535a005406d3fa399e30b8c758;p=krb5.git Have kinit, klist and klist_keytab in k5test.realm take keyword args Apply patch from Linus Nordberg. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25119 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/k5test.py b/src/util/k5test.py index 89551dde5..b22766380 100644 --- a/src/util/k5test.py +++ b/src/util/k5test.py @@ -859,28 +859,29 @@ class K5Realm(object): def extract_keytab(self, princname, keytab): self.run_kadminl('ktadd -k %s -norandkey %s' % (keytab, princname)) - def kinit(self, princname, password=None, flags=[]): + def kinit(self, princname, password=None, flags=[], **keywords): if password: input = password + "\n" else: input = None - self.run_as_client([kinit] + flags + [princname], input=input) + self.run_as_client([kinit] + flags + [princname], input=input, + **keywords) - def klist(self, client_princ, service_princ=None, ccache=None): + def klist(self, client_princ, service_princ=None, ccache=None, **keywords): if service_princ is None: service_princ = self.krbtgt_princ if ccache is None: ccache = self.ccache - output = self.run_as_client([klist, ccache]) + output = self.run_as_client([klist, ccache], **keywords) if (('Ticket cache: FILE:%s\n' % ccache) not in output or ('Default principal: %s\n' % client_princ) not in output or service_princ not in output): fail('Unexpected klist output.') - def klist_keytab(self, princ, keytab=None): + def klist_keytab(self, princ, keytab=None, **keywords): if keytab is None: keytab = self.keytab - output = self.run_as_client([klist, '-k', keytab]) + output = self.run_as_client([klist, '-k', keytab], **keywords) if (('Keytab name: FILE:%s\n' % keytab) not in output or 'KVNO Principal\n----' not in output or princ not in output):