Different CGI scripts on kotnetcli test server should communicate via a simple YAML file, acting as a persistent database back-end. To ensure deterministic test behavior, we want to start up with "clean"/known database state every time we re-start server.py. I therefore propose to:
- create an
init_db.yml file in kotnetcli/server with known dummy state
- before starting the CGIHTTPServer,
server.py copies this file into a new temporary file, say tmp_db.yml (see https://docs.python.org/2/library/tempfile.html)
- on
cgi-bin/wayf2.pl GET request for a specific user, the returned pwdxxx and a timestamp are saved into tmp_db.yml (as a yaml attribute for that user)
- on
cgi-bin/netlogin.pl POST request, the info from tmp_db.yml is used to validate the request; on success, the IP address and other relevant info is stored in tmp_db.yml (as a yaml attribute for that user)
Different CGI scripts on kotnetcli test server should communicate via a simple YAML file, acting as a persistent database back-end. To ensure deterministic test behavior, we want to start up with "clean"/known database state every time we re-start
server.py. I therefore propose to:init_db.ymlfile inkotnetcli/serverwith known dummy stateserver.pycopies this file into a new temporary file, saytmp_db.yml(see https://docs.python.org/2/library/tempfile.html)cgi-bin/wayf2.plGET request for a specific user, the returnedpwdxxxand a timestamp are saved intotmp_db.yml(as a yaml attribute for that user)cgi-bin/netlogin.plPOST request, the info fromtmp_db.ymlis used to validate the request; on success, the IP address and other relevant info is stored intmp_db.yml(as a yaml attribute for that user)