@@ -126,6 +126,15 @@ def get_ws_tls_status(host: dict) -> bool:
126126 except urllib .request .HTTPError as response :
127127 return response .code == 426
128128
129+ def get_ndn_cert_expiry (cert_path : str ) -> int :
130+ print (f'Getting expirty for { cert_path } ' , file = sys .stderr )
131+ try :
132+ cmd = ['python3' , '/testbed/scripts/cert-check.py' , cert_path ]
133+ output = subprocess .check_output (cmd , timeout = 5 )
134+ return int (output .strip ())
135+ except subprocess .CalledProcessError as e :
136+ return 0
137+
129138if __name__ == '__main__' :
130139 config = conf .get ()
131140
@@ -147,6 +156,7 @@ def get_ws_tls_status(host: dict) -> bool:
147156 'host_info' : run_safe (get_host_info ),
148157 'tls' : run_safe (get_tls_status , host ),
149158 'ws-tls' : run_safe (get_ws_tls_status , host ),
159+ 'site_cert_expiry' : run_safe (get_ndn_cert_expiry , "/testbed/dist/ndncert/site.ndncert" ),
150160 'services' : run_safe (get_services ),
151161 'nfd' : run_safe (get_nfd ),
152162 'nlsr' : run_safe (get_nlsr ),
0 commit comments