Add integration test to ensure that signatures are verified #103
No reviewers
Labels
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: LemmyNet/lemmy#103
Loading…
Reference in New Issue
No description provided.
Delete Branch "integration-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Left some comments.
@ -21,3 +21,3 @@
- cd docker/travis
script:
- "./run-tests.sh"
- "./run-tests.bash"
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.Thanks, renamed that file as well for consistency.
@ -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
Why remove workspace here, it no longer runs the tests in DB.
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()
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()
Same for community.
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
Errvalue: Databa seError(UniqueViolation, "duplicate key value violates unique constraint \"idx_user_lower_actor_id\"")', tests/integration_ test.rs:104:3
Updated