awslabs / awslabs/speke-reference-server
Failing tests due to missing setup
- Dominant language
- Python
- Stars
- 124
- Forks
- 50
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 1
Description
Hello,
I have followed the steps in the [installation guide](https://github.com/awslabs/speke-reference-server/blob/master/INSTALL.md) to create an instance of the SPEKE Reference Server using the hosted template and pre-built binaries.
When I run the [manual test for the lambda Server](https://github.com/awslabs/speke-reference-server/blob/master/tests/README.md#server-test), I get a successful response, but the encoded value in the `IakD9BOe/LWABBMy43GXZw==
```
rather than:
```
ALzP1aOTJvzfqg9I12k2Vw==
```
Similarly, if I run the automated tests, the assertions for the server tests fail:
```
======================================================================
FAIL: test_server (__main__.TestSPEKELambdas)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lambda_tests.py", line 107, in test_server
self.assertEqual(EXPECTED_SERVER_KEY, base64.b64decode(key.text))
AssertionError: b'\x00\xbc\xcf\xd5\xa3\x93&\xfc\xdf\xaa\x0fH\xd7i6W' != b'!\xa9\x03\xf4\x13\x9e\xfc\xb5\x80\x04\x132\xe3q\x97g'
```
Looking at the code in `key_generator.py`, it seems that the keys are generated as a function of a secret per contentId and the keyId itself. The secret values are randomly generated rather than set to a known value by the test setup which I think accounts for the different results. I presume that these tests must have either been added/amended after the secrets had been generated in the original environment so will work fine there, but not in a new environment with different generated secrets.
Contributor guide
Research direction
Start with tests/README.md and the server test, then inspect lambda_tests.py around test_server and key_generator.py to trace how secrets affect the generated key. Done means the automated server assertions and documented manual response are consistent when the test setup is run in a new environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100