Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow viewing of Tor browser functional test over VNC #3721

Closed
wants to merge 63 commits into from

Conversation

msheiny
Copy link
Contributor

@msheiny msheiny commented Aug 17, 2018

Status

Ready for review

Description of Changes

Fixes #3718

Changes proposed in this pull request:

  • Does some re-configuration with the existing VNC helper function and uses Xvnc instead (quite frankly I had a lot of issues trying to get it working with x11vnc + Xvfb )
  • Adds some helper commands

Testing

How should the reviewer test this PR?

If you want to test against a remote server:

  • Start a staging server (either via the upgrade scenario or manually)
  • If you didn't use upgrade scenario - fill out the instance_information.json and do the create_dev dance
  • Start the tests cd securedrop ; ./bin/dev-shell ./bin/run-test tests/functional
  • While those are running (once you start seeing test section) run make func-vnc )
  • 🎉 you should see the tests running

Of special note is that I did NOT run this under macOS yet so I'll need anyone with macOS cough cough @redshiftzero cough to take a look and make sure that make func-vnc call works

Checklist

  • How many woodchucks?

kushaldas and others added 30 commits August 8, 2018 15:24
This prevents the accidental commit of private information.
The 'when' conditional detecting a grsec kernel, used for running the
paxctl commands on the TBB binary, was needlessly duplicated on the
relevant task. Fortunately that didn't cause breakage, because the
'when' lines were identical, but only one was active.
Now installs Firefox 52 ESR, rather than Firefox 46, for use inside the
test container.

Includes changes to run-test shell script:

    TOR_FORCE_NET_CONFIG=0 is required to directly connect to Tor
    network, otherwise it will wait for userinput to either connect
    or to configure

    The `run_xvfb` invocation is no longer necessary, since the test suite
    code bootstraps the headless server now.
Bootstrapping the application services within the functional test suite.
Includes some cleanup, culling unused debugging code, and also cleans up
the various print statements.

Ignore functional test firefox logs (thanks, @msheiny!)

Adds retries for tor network connection failure, using the pre-existing
logic.
The version of torsocks in the Trusty repos isn't recent enough to
support custom ports. Rather than install from other sources, which
requires manual package verification (or configuring non-trusty repos,
which could break other packages), let's fall back to good ol' nc.
We need to create a new firefox profile to test the orbot specific
warning. This works for both locally and over Tor.
Now we can safely execute the account changes in the tests running
on the Tor browser. The logic update makes sure to create different
user for this test than any other test.
msheiny and others added 9 commits August 10, 2018 14:57
This directory no longer exists with modern molecule versions and the
ephemeral directory is now something like
/tmp/molecule/${git_dir}/${scenario_dir}
Adds --staging flag create-dev-data.py for tests
Tor functional test auto generation of  instance_information.json
In #3697, we removed the application testing pip dependencies.
This commit updates the testinfra test variables accordingly.
This is temporary until grsec kernels are run in CI
One of these was introduced in #3672, but not discovered due to
other CI failures (e.g. python not found when running the lint job)
Fix CI lint and staging jobs on tbb-0.9.0
I'm hoping this shakes out some really weird test failures we were
seeing only under CircleCI only under the functional testing branch at a
certain point in time. Really wild behavior. *fingers crossed*
Use absolute pathing in i18n testing
@msheiny
Copy link
Contributor Author

msheiny commented Aug 17, 2018

oh i need a rebase here.. hold on

Basically installed this because it can be used with pyvirtualdisplay as
a backend AND because it brings in the Xvnc tooling which will start an
X11 server as well as a VNC server.
Had to remove x11 display logic inside test scaffolding (initially tried
to integrate it there but it kept building and destroying the VNC server
per test).

Made a VNC helper command with support for GNOME desktop and macOS (havent
tested it on mac yet). Updated the docs
10 seconds is way too short.. 160 seconds.. maybe too long? Fingers
crossed I can work with the team to get the wait_for logic running
Typically these actions were done manually but lets get our good old
friend ansible to run them for us (at least under the upgrade env).
@msheiny
Copy link
Contributor Author

msheiny commented Aug 17, 2018

ummmmmm i have no idea why that admin test is failing... waiting until the rest finish to restart but it passes locally with no probs

@codecov-io
Copy link

codecov-io commented Aug 17, 2018

Codecov Report

Merging #3721 into tbb-0.9.0 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           tbb-0.9.0    #3721   +/-   ##
==========================================
  Coverage      85.16%   85.16%           
==========================================
  Files             41       41           
  Lines           2643     2643           
  Branches         287      287           
==========================================
  Hits            2251     2251           
  Misses           329      329           
  Partials          63       63

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78743d6...b6755fe. Read the comment docs.

Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked nicely in my machine. Thank you @msheiny 👍

Copy link
Contributor

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment inline from the macOS-based SecureDrop developer community

# Find our securedrop docker ip
SD_DOCKER_IP="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' securedrop-dev)"

# Quit if the VNC port not found
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I don't think this will work for macOS users that are using Docker for Mac, as per-container IP addressing is apparently not implemented (discovered this when debugging why this wasn't working for me on my mac). That said, in the spirit of not blocking people on Linux working on the functional tests, unless I am incorrect about the above, I propose we do the following and merge this:

  1. Add logic above this line that if $(uname -s)" == "Darwin", explains that the VNC access will not work on macOS and exit 1 (snipping out the mac logic on lines 24-25)
  2. Add a note to the developer docs here explaining how to run the functional tests on Linux (basically copypasta the PR testing instructions)

Let me know what you think!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @redshiftzero - Yeah, I agree but I don't want this to be another feature that doesn't have Mac support. 👎 Let me see if I can tweak some things real quick

@zenmonkeykstop
Copy link
Contributor

zenmonkeykstop commented Sep 17, 2018

Got VNC working with functional tests on OS X by:

  1. Adding -P flag to docker run command in bin/dev-shell to publish ports
  2. using docker port securedrop-dev to find what 5901 was mapped to locally (could skip this by using -p DOCKERPORT:LOCALPORT instead of -P)
  3. starting up a vnc client (tigerVNC in my case, built-in VNC wasn't working for me) pointing at 0.0.0.0:LOCALPORT while the tests were running.

So it's absolutely possible for OS X, if you're ok with publishing the ports from the securedrop-dev container.

@redshiftzero
Copy link
Contributor

superseded by #3817

@legoktm legoktm deleted the VNCThyme branch January 9, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants