---
# System prepended metadata

title: Project 2 - Draft Test Proposal

---

# Project 2 - Draft Test Proposal

## Test 1 - Persistence
**Design Requirement**: Check if the user has access to the same set of files after they log out and log in later.

1. Make sure User 2 cannot access file `f` 
2. User 1 gives access to User 2 for `f`
3. User 2 is able to access `f` during current login
4. User 2 logs out 
5. User 2 logs in
6. User 2 should still have access to `f`


## Test 2 - Filename should be hidden and protect the length 
**Design Requirement**: Making sure that an adversary cannot get name or length of files from the data in DataStore and KeyStore 

1. Mallory calls `StoreFile(f1, c1 []byte)`
2. Mallory calls `StoreFile(f2, c2 []byte)`
3. Define FetchDataStore(), which returns all the name-value pairs in the DataStore. 
4. Assert none of the pairs contain `f1` or `f2` else filenames are compromised

## Test 3 - Case Sensitivity in Usernames
**Design Requirement**: Given that a user creates a username `alice`, they should not be able to login with `Alice`, `ALICE` or any other variant where the case does not match. Username must be case senstive. 

1. User 1 initializes a user with username `alice` and password `pass123`
2. Assert User 1 can login with ('alice', 'pass123')
3. Assert User 1 cannot login with ('ALICE', 'pass123') given that there is no other user with username `ALICE` who also has password 'pass123'
4. Assert User 1 cannot login with ('Alice', 'pass123')  given that there is no other user with username `Alice` who also has password 'pass123'

## Test 4 - LoadFile accesses with proper Parent
**Design Requirement**: Checking if sharing is working as intended. If Alice has `foo.txt` in her file namespace and Bob has `foo.txt` in his file namespace. Alice shares file with Phil McCrevis. Now, when Phil McCrevis requests the file `foo.txt` from LoadFile, it should load Alice's `foo.txt` and not Bob's `foo.txt`.

1. ALice creates and stores `foo.txt`
2. Alice shares `foo.txt` with Phil McCrevis who saves it as `foo.txt` in their file namespace
3. Bob creates and stores `foo.txt` 
4. When Phil McCrevis calls LoadFile on `foo.txt`, assert that it returns Alice's version and not Bob's. 

## Test 5 - Revoked User Adversary can't interact with DataStore to modify files - No Country for Old Keys
**Design Requirement**: Check if a revoked user Bob is able to access the revoked file with his old keys by interacting directly with the DataStore.

1. Alice shares `foo.txt` with Bob 
2. Bob can now access `foo.txt` with the valid Symmetric keys required to access `foo.txt`
3. Alice revokes Bob's access 
4. Assert keys are changed and that Bob can no longer use the old Keys to access `foo.txt` using any internal/external API calls 

## Test 6 - Overwrite File 
**Design Requirement**: Check if a User tries to call StoreFile on a filename that already exists in their namespace, then we should not generate new set of key's or create another entry in the file namespace 

1. Alice creates `foo.txt` with contents `c1` and shares with Bob
3. Bob calls StoreFile on `foo.txt` with new set of []byte content `c2`
4. Assert that we do not generate new keys for `foo.txt` since it will be a modification of Alice's version of `foo.txt`
5. Assert contents(`foo.txt`) == c2  
