Skip to content

Test Case Publication

Sofía Celi edited this page Jun 7, 2019 · 9 revisions

This test script serves the purpose of making sure that publication of different data happens correctly.

Assumptions

  • This test will be run with alice@ and bob@ running with the localhost xmpp server

Before running test

  • Start Pidgin:
    • Enable alice@ and bob@
    • Shut down Pidgin
  • Remove all published values in prekey server (remove the keys folder)
  • Remove all files starting with otr4. in the Pidgin configuration directory (defaults to ~/.purple).
  • Remove any entries in the otr.fingerprints file (in the Pidgin configuration directory) that is for alice@ or bob@
  • Make sure the XMPP server, otrng prekey server and XMPP prekey server are running

Running the test

  • Start Pidgin
  • Ensure that you see (in the console output) (the order will vary)
    • "Prekey Server: we have 0 prekey messages stored." (one for alice and one for bob)
    • "Prekey Server: Publishing x Prekey Messages" (one for alice and one for bob)
    • "Prekey Server: Publishing Client Profile" (one for alice and one for bob)
    • "Prekey Server: Publishing Prekey Profile" (one for alice and one for bob)
    • "Prekey Server: received success" (one for alice and one for bob)
  • Shut down Pidgin
  • Open up otr.instance_tags in the Pidgin configuration directory. Find the entries for alice@ and bob@ and note down their respective instance tags. They will be referred to as 'BOB_ITAG' and 'ALICE_TAG' below.
  • Ensure the otrng prekey server data directory contains the correct values:
    • A directory tree that looks like this:
      • 4050
        • 405010D6C16C16DEC36F3D7A7596C2D757BA7B57904ADC4801A63E40914FD5C9
          • 'BOB_ITAG' (upper case)
            • cp.bin
            • pp.bin
            • pm
              • (exactly 100 files, ending in .bin)
      • 93C5
        • 93C56F4408CFF66F0A929AEA8E3940E753C3275E5622582AE3010E7277B7696C
          • 'ALICE_ITAG' (upper case)
            • cp.bin
            • pp.bin
            • pm
              • (exactly 100 files, ending in .bin)
  • Copy the cp.bin and pp.bin files somewhere, for comparison

Republishing the Client Profile

  • Open otr4.client_profile in the Pidgin configuration directory and delete the line for alice@, and the following line (this should leave only two lines left in the file).
  • Start Pidgin
  • Ensure that you see (in the console output) (the order will vary)
    • "Prekey Server: we have 'x' prekey messages stored"
    • Start an offline conversation with Bob.
    • This should trigger the publication of the new client profile: this line should show up "Prekey Server: Publishing Client Profile" and "Prekey Server: received success"
  • Shut down Pidgin
  • Look in the prekey server data storage tree, inside 93C5/93C56F4408CFF66F0A929AEA8E3940E753C3275E5622582AE3010E7277B7696C/ALICE_ITAG
  • Ensure that the cp.bin file is different from the one you stored earlier
  • Ensure that the pp.bin file is unmodified
  • Ensure that the files in pm have not been modified either

Republishing the Prekey Profile

  • Open otr4.prekey_profile in the Pidgin configuration directory and delete the line for alice@, and the following line (this should leave only two lines left in the file).

  • Start Pidgin

  • Ensure that you see (in the console output) (the order will vary)

    • "Prekey Server: we have 'x' prekey messages stored"
    • Start an offline conversation with Bob.
    • This should trigger the publication of the new client profile: this line should show up "Prekey Server: Publishing Prekey Profile" and "Prekey Server: received success"
  • Shut down Pidgin

  • Look in the prekey server data storage tree, inside 93C5/93C56F4408CFF66F0A929AEA8E3940E753C3275E5622582AE3010E7277B7696C/ALICE_ITAG

  • Ensure that the pp.bin file is different from the one you stored earlier

  • Ensure that the cp.bin file is unmodified

  • Ensure that the files in pm have not been modified either

  • TODO: write another test case where we remove the long term key, trigger publication of both client profile and prekey profile

  • TODO: start a non-interactive conversation and make sure a prekey message disappears from the server

  • TODO: remove all prekey messages from the server, and make sure a republication happens, without touching the client profile and prekey profile