Skip to content

Commit

Permalink
Fix basic IPA test
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Sep 20, 2024
1 parent 46ae134 commit 5181954
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ipa-basic-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ jobs:
run: |
docker exec ipa pki-server subsystem-find | tee output
# IPA server should have CA subsystem
# IPA server should have CA and ACME subsystems
echo "ca" > expected
echo "acme" >> expected
sed -n 's/^ *Subsystem ID: *\(.*\)$/\1/p' output > actual
diff expected actual
docker exec ipa pki-server subsystem-show ca | tee output
# CA subsystem should be enabled
# all subsystems should be enabled
echo "True" > expected
echo "True" >> expected
sed -n 's/^ *Enabled: *\(.*\)$/\1/p' output > actual
diff expected actual
Expand Down Expand Up @@ -248,16 +248,17 @@ jobs:
run: |
docker exec ipa pki-server subsystem-find | tee output
# IPA server should now have CA and KRA subsystems
# IPA server should now have CA, KRA, and ACME subsystems
echo "ca" > expected
echo "kra" >> expected
echo "acme" >> expected
sed -n 's/^ *Subsystem ID: *\(.*\)$/\1/p' output > actual
diff expected actual
docker exec ipa pki-server subsystem-show kra | tee output
# KRA subsystem should be enabled
# all subsystems should be enabled
echo "True" > expected
echo "True" >> expected
echo "True" >> expected
sed -n 's/^ *Enabled: *\(.*\)$/\1/p' output > actual
diff expected actual
Expand Down
19 changes: 9 additions & 10 deletions base/server/python/pki/server/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,22 +351,21 @@ def get_subsystem_index(self, subsystem_id):

def find_system_certs(self):

cert_tags = self.config['%s.cert.list' % self.name].split(',')
cert_list = self.config.get('%s.cert.list' % self.name)
if not cert_list:
return []

for cert_tag in cert_tags:
for cert_tag in cert_list.split(','):
yield self.get_subsystem_cert(cert_tag)

def get_cert_infos(self):

cert_tags = self.config['%s.cert.list' % self.name].split(',')
cert_list = self.config.get('%s.cert.list' % self.name)
if not cert_list:
return []

certs = []

for cert_tag in cert_tags:
cert = self.get_cert_info(cert_tag)
certs.append(cert)

return certs
for cert_tag in cert_list.split(','):
yield self.get_cert_info(cert_tag)

def get_subsystem_cert(self, tag):

Expand Down

0 comments on commit 5181954

Please sign in to comment.