run_part2_tests module

Autograder tests for Part 2.

Run this script (python3 run_part2_tests.py) from the same directory as your client.py file. This will run all of the functionality tests for Part 2 of the project.

class run_part2_tests.PerfServer

Bases: servers.StorageServer

delete(k)
get(k)
put(k, v)
size = 0
class run_part2_tests.StudentTester(theclass)

Bases: object

run_test(t, Server=<class 'servers.StorageServer'>, Crypto=<class 'crypto.Crypto'>, Pks=<class 'servers.PublicKeyServer'>)
run_part2_tests.f(C, pks, crypto, server=<class 'run_part2_tests.PerfServer'>, size=1048576, other=False)

The simplest performance test: put a 1MB value on the server, and update a single byte in the middle. Count number of bytes changed.

run_part2_tests.t01_StoreManyKeys(C, pks, crypto, server)

Verify that it is reasonably efficient to store many keys on the server.

run_part2_tests.t02_OverwritePuts(C, pks, crypto, server)

A long file when changed byte by byte will have the correct result at the end.

run_part2_tests.t03_MoreOverwritePuts(C, pks, crypto, server)

A long file when changed many bytes at a time, will have the correct result at the end.

run_part2_tests.t04_LengthChangingPuts(C, pks, crypto, server)

Verifies that it is possible to change the length of a file once on the server.

run_part2_tests.t05_SmallLengthChangingPuts(C, pks, crypto, server)

Randomly adds or deletes a small number of bytes from a file, and ensures data is correct.

run_part2_tests.t06_PutOffByOneSize(C, pks, crypto, server)

Uploads a file with only a few bytes different by changing its length.

run_part2_tests.t07_SimpleSharing(C, pks, crypto, server)

Checks that sharing works in the simplest case of sharing one file.

run_part2_tests.t08_SimpleTransitiveSharing(C, pks, crypto, server)

Checks that sharing a file can be done multiple times and is transitive.

run_part2_tests.t09_SharingIsPassByReference(C, pks, crypto, server)

Verifies that updates to a file are sent to all other users who have that file.

run_part2_tests.t10_SharingIsPassByReference2(C, pks, crypto, server)

Verifies that updates to a file are sent to all other users who have that file.

run_part2_tests.t11_EfficientPutChangedData(C, pks, crypto, server)

Verifies that when two users have access to a file they keep their state current.

run_part2_tests.t12_SharedStateIsChecked(C, pks, crypto, server)

Verifies that when two users have access to a file they keep their state current.

run_part2_tests.t13_ShareRevokeShare(C, pks, crypto, server)

Checks that after a user has been revoked from a file, they can receive it again.

run_part2_tests.t14_SimpleSubtreeRevoke(C, pks, crypto, server)

Simple verification that revocation also revokes all grandchildren of a file.

run_part2_tests.t15_MultiLevelSharingRevocation(C, pks, crypto, server)

Creates many users and shares the file in a random tree structure, revoking one child, and verifies that updates are correctly reflected.

run_part2_tests.z01_SimplePerformanceTest(C, pks, crypto, server=<class 'run_part2_tests.PerfServer'>, size=1048576, other=False)

The simplest performance test: put a 1MB value on the server, and update a single byte in the middle. Count number of bytes changed.

run_part2_tests.z02_SimpleAlgorithmicPerformanceTest(C, pks, crypto, server=<class 'run_part2_tests.PerfServer'>)

Try to compute the order-of-complexity of the algorithm being used when updating a single byte. Let n be the size of the initial value stored. In the worst case, an O(n) algorithm re-updates every byte. An O(1) algorithm updates only a constant number of bytes

run_part2_tests.z03_SharingPerformanceTest(C, pks, crypto, server=<class 'run_part2_tests.PerfServer'>, size=1048576)

The simplest performance test: put a 1MB value on the server, and update a single byte in the middle. Count number of bytes changed.

run_part2_tests.z04_NonSingleSharingPerformanceTest(C, pks, crypto, server=<class 'run_part2_tests.PerfServer'>, size=1048576, other=False)

The simplest performance test: put a 1MB value on the server, and update a single byte in the middle. Count number of bytes changed.