owncast/test
Alyssa Ross 092134f3f3
Fix parsing of Authorization Bearer header (#3376)
The semantics of the Authorization header are defined by RFC 9110, which says:

> It uses a case-insensitive token to identify the authentication scheme:

Therefore, "bearer", "Bearer", and "bEARER" are equivalent.  This patch fixes
the parsing of the Authorization header to check for the Bearer authentication
scheme case insensitively.

I've modified one of the test cases to use lowercase "bearer", so there's test
coverage for this.
2023-10-21 10:00:50 -07:00
..
automated Fix parsing of Authorization Bearer header (#3376) 2023-10-21 10:00:50 -07:00
load Bump fast-xml-parser and artillery in /test/load (#3300) 2023-09-10 10:46:00 -07:00
.gitignore Point fakechat test script to localhost by default. Commit package.json 2021-01-02 12:16:53 -08:00
fakeChat.js Chat refactor + persistent backing chat users (#1163) 2021-07-19 19:22:29 -07:00
ocTestStream.sh Fix HLS automatic test (#2572) 2023-01-11 20:11:13 -08:00
package-lock.json Bump node-fetch from 2.6.6 to 2.6.7 in /test (#1700) 2022-01-24 10:44:04 -08:00
package.json Bump node-fetch from 2.6.6 to 2.6.7 in /test (#1700) 2022-01-24 10:44:04 -08:00
populateContent.sh Change host in fixture script 2022-10-02 21:40:15 -07:00
README.md chore(tests): add readme note about remote host testing 2023-04-19 09:40:19 -07:00
test-local.sh chore: add local<->public test script 2023-04-18 18:04:57 -07:00
userColorsTest.js Update chat styling 2020-10-16 17:46:44 -07:00

Tests

Load Tests

  1. Install artillery from NPM/Yarn/Whatever Javascript package manager is popular this week.
  2. Start an instance of the server on localhost.
  3. artillery run httpGetTest.yaml for endpoint load tests.
  4. artillery run websocketTest.yaml for websocket load tests.

Chat test

This will send automated fake chat messages to your localhost instance. Edit the messages, usernames or point to a different instance.

  1. npm install
  2. node fakeChat.js

Public Testing

Run ./test-local.sh and it'll create a public URL that you can access your local Owncast instance from. This is particularly useful for testing mobile and other external devices, as well as webhooks. Make sure Owncast is running under port 8080.

If you'd like your own custom hostname that uses your username follow the instructions printed, otherwise use auto-generated name printed to the console for testing.

$ ./test/test-local.sh
Please wait. Making the local server port 8080 available at https://oc-gabek-develop.serveo.net
Forwarding HTTP traffic from https://oc-gabek-develop.serveo.net