Using the Local Autograder (...for Project 2)
Running testcases, using ./helper interactive
, and zipping up your submission are all the same, but there are a couple of key differences when using the autograder for Project 2.
#Manual Testing
A large part of Project 2 is managing keys and certificates. As per the spec, the CA public key, the server private key, and the server’s certificate (signed by the CA) are all in the current working directory.
In /autograder/source/keys
, there’s a script called gen_files
. This script will automatically generate the requisite files to test your code.
Since the files are in this directory, running the executables manually is a bit different.
$ cd /autograder/submission
$ make
$ cd /autograder/source/keys
$ ./gen_files
$ ../../submission/server 8080
$ ../src/server 8080 # To use the reference implementation
In short, test out the binaries while the CWD is /autograder/source/keys
.
#Not just localhost
anymore
In Project 1, we ran ./client localhost 8080
without much regard to what localhost
means. In Project 2, the hostname (first command line argument) is a real DNS name.
The starter code will automatically run DNS to find the IP address of the hostname. Feel free to continue testing with localhost
since that’s what the default DNS name
will be in the certificates we give you, but your solution should work for any DNS name.
#Custom Test Cases
To test out odd functionality, you may switch out the secondary versions of files.
- The two
ca_public_key.bin
files can be switched out to test if your client is checking for the CA’s signature properly. - The two
server_key.bin
files can be switched out to test if your client is checking that the server really does own the certificate. - The two
server_cert.bin
files can be switched out to test if your client is checking the DNS name properly (The regular one haslocalhost
as the DNS name, but the other hasexample.com
.