Add integration test to ensure that signatures are verified #103

Merged
dessalines merged 4 commits from integration-test into main 2020-09-22 15:10:29 +00:00
Owner

This basically ensures that the inbox rejects requests with invalid signature. I will also add the same for user_inbox and community_inbox. Many other things worth testing are already checked by federation tests, so I'm not sure what else to add.

This basically ensures that the inbox rejects requests with invalid signature. I will also add the same for user_inbox and community_inbox. Many other things worth testing are already checked by federation tests, so I'm not sure what else to add.
dessalines requested changes 2020-09-21 13:49:03 +00:00
dessalines left a comment
Owner

Left some comments.

Left some comments.
@ -21,3 +21,3 @@
- cd docker/travis
script:
- "./run-tests.sh"
- "./run-tests.bash"
Owner

The correct one is in the travis folder, not the federation folder. I actually haven't figured out how to do cargo test in travis.

The correct one is in the travis folder, not the federation folder. I actually haven't figured out how to do `cargo test` in travis.
Author
Owner

Thanks, renamed that file as well for consistency.

Thanks, renamed that file as well for consistency.
test.sh Outdated
@ -3,3 +3,3 @@
diesel migration run
export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
RUST_TEST_THREADS=1 cargo test --workspace --no-fail-fast
RUST_TEST_THREADS=1 RUST_BACKTRACE=1 cargo test -j8 --no-fail-fast -- --nocapture
Owner

Why remove workspace here, it no longer runs the tests in DB.

Why remove workspace here, it no longer runs the tests in DB.
Author
Owner

Sorry I changed it during my testing to speed things up, but forgot to change it back.

Sorry I changed it during my testing to speed things up, but forgot to change it back.
@ -0,0 +101,4 @@
last_refreshed_at: None,
};
User_::create(&conn, &new_user).unwrap()
Owner

This needs a teardown / delete the user after its been used.

This needs a teardown / delete the user after its been used.
@ -0,0 +124,4 @@
icon: None,
banner: None,
};
Community::create(&conn, &new_community).unwrap()
Owner

Same for community.

Same for community.
Owner

Yeah that's verified, running the tests twice will get you unique key violations:

FAILED test test_shared_inbox_expired_signature ... thread 'main' panicked at 'called Result::unwrap()on anErr value: Databa seError(UniqueViolation, "duplicate key value violates unique constraint \"idx_user_lower_actor_id\"")', tests/integration_ test.rs:104:3

Yeah that's verified, running the tests twice will get you unique key violations: `FAILED test test_shared_inbox_expired_signature ... thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Databa seError(UniqueViolation, "duplicate key value violates unique constraint \"idx_user_lower_actor_id\"")', tests/integration_ test.rs:104:3`
Author
Owner

Updated

Updated
dessalines merged commit 8e69801e24 into main 2020-09-22 15:10:29 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: LemmyNet/lemmy#103
No description provided.