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

Create split gpg tests #1368

Closed
marmarek opened this Issue Nov 1, 2015 · 28 comments

Comments

@marmarek
Member

marmarek commented Nov 1, 2015

  • standalone split gpg tests
  • split gpg + mutt tests
  • split gpg + thunderbird

@marmarek marmarek added this to the Release 3.1 milestone Nov 2, 2015

marmarek added a commit to marmarek/old-qubes-core-admin that referenced this issue Feb 29, 2016

tests: direct gpg-split testing
Basic tests for direct qubes-gpg-client-wrapper calls.

QubesOS/qubes-issues#1368

marmarek added a commit to marmarek/old-qubes-core-admin that referenced this issue Feb 29, 2016

tests: gpg-split + thunderbid
Use dogtail testing framework to handle thunderbird GUI.

QubesOS/qubes-issues#1368
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Feb 29, 2016

Member

@woju take a look at the last commit here. There a python script which is called in the VM. Since tests are started from dom0, I've stored it inside a string variable in test case and send it to the VM just before execution - to avoid dealing with dom0-vm version synchronization.
While IMHO sending the script from dom0 just before execution is fine, storing it as giant string block is quite ugly. Any better idea?

Member

marmarek commented Feb 29, 2016

@woju take a look at the last commit here. There a python script which is called in the VM. Since tests are started from dom0, I've stored it inside a string variable in test case and send it to the VM just before execution - to avoid dealing with dom0-vm version synchronization.
While IMHO sending the script from dom0 just before execution is fine, storing it as giant string block is quite ugly. Any better idea?

@woju

This comment has been minimized.

Show comment
Hide comment
@woju

woju Feb 29, 2016

Member

On Sun, Feb 28, 2016 at 05:49:39PM -0800, Marek Marczykowski-Górecki wrote:

@woju take a look at the last commit here. There a python script which
is called in the VM. Since tests are started from dom0, I've stored it
inside a string variable in test case and send it to the VM just
before execution - to avoid dealing with dom0-vm version
synchronization.

While IMHO sending the script from dom0 just before execution is fine,
storing it as giant string block is quite ugly. Any better idea?

I would prefer the tests for the Qubes applications (not core,
gui-protocol, etc.) to not be part of core tests suite. Could they be
part of their respective packages and only called from dom0 via qvm-run
or some custom qrexec? I can write a multiplexer for such qrexec, so the
"vm" tests suite would be seen as one qrexec call, irrespective of which
ones are actually installed?

regards, .-.
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>

Member

woju commented Feb 29, 2016

On Sun, Feb 28, 2016 at 05:49:39PM -0800, Marek Marczykowski-Górecki wrote:

@woju take a look at the last commit here. There a python script which
is called in the VM. Since tests are started from dom0, I've stored it
inside a string variable in test case and send it to the VM just
before execution - to avoid dealing with dom0-vm version
synchronization.

While IMHO sending the script from dom0 just before execution is fine,
storing it as giant string block is quite ugly. Any better idea?

I would prefer the tests for the Qubes applications (not core,
gui-protocol, etc.) to not be part of core tests suite. Could they be
part of their respective packages and only called from dom0 via qvm-run
or some custom qrexec? I can write a multiplexer for such qrexec, so the
"vm" tests suite would be seen as one qrexec call, irrespective of which
ones are actually installed?

regards, .-.
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Feb 29, 2016

Member

On Mon, Feb 29, 2016 at 06:58:36AM -0800, Wojtek Porczyk wrote:

I would prefer the tests for the Qubes applications (not core,
gui-protocol, etc.) to not be part of core tests suite. Could they be
part of their respective packages and only called from dom0 via qvm-run
or some custom qrexec? I can write a multiplexer for such qrexec, so the
"vm" tests suite would be seen as one qrexec call, irrespective of which
ones are actually installed?

There are few issues with this approach (applied directly):

  1. You need to create VMs for the test - in this case two of them
    (backend, frontend), and allow qubes.Gpg service calls. This isn't
    possible from within VM of course. And as you can see, "one generic VM
    to run any test there" isn't enough. You need some test-specific code in
    dom0.
  2. If all the Qubes applications tests will be running as a single "vm"
    test, it would be harder to get meaningful result report. Especially if
    one want to parse it automatically (which I'm considering already - to
    have a nice table which test fails in which template).
  3. If calling such tests will be a separate test runner call, it would
    be harder to launch all the tests.

Anyway I agree that it would be better to have those tests outside of core
tests suite (at least in terms of repositories and packaging). Maybe
there should be dedicated directory ("python package") for such tests,
like "qubes.tests.app" (this one would be in "qubes.tests.app.split_gpg").
Then it can be stored in qubes-app-linux-split-gpg repository, packaged
as a separate rpm. I think the only thing preventing this approach now,
is that tests/init.py explicitly list all test packages (static
list). Maybe such tests should be held outside "qubes" package and
loaded using some other mechanism? Something about that "egg-info"
you've shown me recently? Something else?

I'm not sure about VM part of the test in such case.
It will be simple enough to store it as a separate file in dom0
(somewhere in /usr/share/...) and transfer to VM as it's done
currently. Or package in VM part of the application (some subpackage
probably). The later one is cleaner (and also take care of
dependencies), but it's harder to maintain test machine - when you add
new test (just that), you need to update both dom0 and templates. This
makes deploying new tests more time consuming (start template, update,
stop template). But maybe still worth to do it, to have cleaner code...

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Member

marmarek commented Feb 29, 2016

On Mon, Feb 29, 2016 at 06:58:36AM -0800, Wojtek Porczyk wrote:

I would prefer the tests for the Qubes applications (not core,
gui-protocol, etc.) to not be part of core tests suite. Could they be
part of their respective packages and only called from dom0 via qvm-run
or some custom qrexec? I can write a multiplexer for such qrexec, so the
"vm" tests suite would be seen as one qrexec call, irrespective of which
ones are actually installed?

There are few issues with this approach (applied directly):

  1. You need to create VMs for the test - in this case two of them
    (backend, frontend), and allow qubes.Gpg service calls. This isn't
    possible from within VM of course. And as you can see, "one generic VM
    to run any test there" isn't enough. You need some test-specific code in
    dom0.
  2. If all the Qubes applications tests will be running as a single "vm"
    test, it would be harder to get meaningful result report. Especially if
    one want to parse it automatically (which I'm considering already - to
    have a nice table which test fails in which template).
  3. If calling such tests will be a separate test runner call, it would
    be harder to launch all the tests.

Anyway I agree that it would be better to have those tests outside of core
tests suite (at least in terms of repositories and packaging). Maybe
there should be dedicated directory ("python package") for such tests,
like "qubes.tests.app" (this one would be in "qubes.tests.app.split_gpg").
Then it can be stored in qubes-app-linux-split-gpg repository, packaged
as a separate rpm. I think the only thing preventing this approach now,
is that tests/init.py explicitly list all test packages (static
list). Maybe such tests should be held outside "qubes" package and
loaded using some other mechanism? Something about that "egg-info"
you've shown me recently? Something else?

I'm not sure about VM part of the test in such case.
It will be simple enough to store it as a separate file in dom0
(somewhere in /usr/share/...) and transfer to VM as it's done
currently. Or package in VM part of the application (some subpackage
probably). The later one is cleaner (and also take care of
dependencies), but it's harder to maintain test machine - when you add
new test (just that), you need to update both dom0 and templates. This
makes deploying new tests more time consuming (start template, update,
stop template). But maybe still worth to do it, to have cleaner code...

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

@woju

This comment has been minimized.

Show comment
Hide comment
@woju

woju Feb 29, 2016

Member

On Mon, Feb 29, 2016 at 12:27:33PM -0800, Marek Marczykowski-Górecki wrote:

On Mon, Feb 29, 2016 at 06:58:36AM -0800, Wojtek Porczyk wrote:

I would prefer the tests for the Qubes applications (not core,
gui-protocol, etc.) to not be part of core tests suite. Could they be
part of their respective packages and only called from dom0 via qvm-run
or some custom qrexec? I can write a multiplexer for such qrexec, so the
"vm" tests suite would be seen as one qrexec call, irrespective of which
ones are actually installed?

There are few issues with this approach (applied directly):

  1. You need to create VMs for the test - in this case two of them
    (backend, frontend), and allow qubes.Gpg service calls. This isn't
    possible from within VM of course. And as you can see, "one generic VM
    to run any test there" isn't enough. You need some test-specific code in
    dom0.

You're right. If we only had management API... Anyway, we won't have
that before implementing those tests.

  1. If all the Qubes applications tests will be running as a single "vm"
    test, it would be harder to get meaningful result report. Especially if
    one want to parse it automatically (which I'm considering already - to
    have a nice table which test fails in which template).
  2. If calling such tests will be a separate test runner call, it would
    be harder to launch all the tests.

Anyway I agree that it would be better to have those tests outside of core
tests suite (at least in terms of repositories and packaging). Maybe
there should be dedicated directory ("python package") for such tests,
like "qubes.tests.app" (this one would be in "qubes.tests.app.split_gpg").
Then it can be stored in qubes-app-linux-split-gpg repository, packaged
as a separate rpm. I think the only thing preventing this approach now,
is that tests/init.py explicitly list all test packages (static
list). Maybe such tests should be held outside "qubes" package and
loaded using some other mechanism? Something about that "egg-info"
you've shown me recently? Something else?

I was thinking about just that, endpoint in this egg-info thingy.

I'm not sure about VM part of the test in such case.
It will be simple enough to store it as a separate file in dom0
(somewhere in /usr/share/...) and transfer to VM as it's done
currently. Or package in VM part of the application (some subpackage
probably). The later one is cleaner (and also take care of
dependencies), but it's harder to maintain test machine - when you add
new test (just that), you need to update both dom0 and templates. This
makes deploying new tests more time consuming (start template, update,
stop template). But maybe still worth to do it, to have cleaner code...

I think it's worth it. Moreover, in earlier message you wrote that
keeping test code in dom0 allows to not think about "version
synchronization". Actually, it creates burden when the app changes.

Could just those py files be distributed in the template (possibly in
some devel packages, but they aren't exceptionally big), but the code be
kept in dom0? That would neccessitate creation of some resonably stable
API, which I think is still easier.

regards, .-.
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>

Member

woju commented Feb 29, 2016

On Mon, Feb 29, 2016 at 12:27:33PM -0800, Marek Marczykowski-Górecki wrote:

On Mon, Feb 29, 2016 at 06:58:36AM -0800, Wojtek Porczyk wrote:

I would prefer the tests for the Qubes applications (not core,
gui-protocol, etc.) to not be part of core tests suite. Could they be
part of their respective packages and only called from dom0 via qvm-run
or some custom qrexec? I can write a multiplexer for such qrexec, so the
"vm" tests suite would be seen as one qrexec call, irrespective of which
ones are actually installed?

There are few issues with this approach (applied directly):

  1. You need to create VMs for the test - in this case two of them
    (backend, frontend), and allow qubes.Gpg service calls. This isn't
    possible from within VM of course. And as you can see, "one generic VM
    to run any test there" isn't enough. You need some test-specific code in
    dom0.

You're right. If we only had management API... Anyway, we won't have
that before implementing those tests.

  1. If all the Qubes applications tests will be running as a single "vm"
    test, it would be harder to get meaningful result report. Especially if
    one want to parse it automatically (which I'm considering already - to
    have a nice table which test fails in which template).
  2. If calling such tests will be a separate test runner call, it would
    be harder to launch all the tests.

Anyway I agree that it would be better to have those tests outside of core
tests suite (at least in terms of repositories and packaging). Maybe
there should be dedicated directory ("python package") for such tests,
like "qubes.tests.app" (this one would be in "qubes.tests.app.split_gpg").
Then it can be stored in qubes-app-linux-split-gpg repository, packaged
as a separate rpm. I think the only thing preventing this approach now,
is that tests/init.py explicitly list all test packages (static
list). Maybe such tests should be held outside "qubes" package and
loaded using some other mechanism? Something about that "egg-info"
you've shown me recently? Something else?

I was thinking about just that, endpoint in this egg-info thingy.

I'm not sure about VM part of the test in such case.
It will be simple enough to store it as a separate file in dom0
(somewhere in /usr/share/...) and transfer to VM as it's done
currently. Or package in VM part of the application (some subpackage
probably). The later one is cleaner (and also take care of
dependencies), but it's harder to maintain test machine - when you add
new test (just that), you need to update both dom0 and templates. This
makes deploying new tests more time consuming (start template, update,
stop template). But maybe still worth to do it, to have cleaner code...

I think it's worth it. Moreover, in earlier message you wrote that
keeping test code in dom0 allows to not think about "version
synchronization". Actually, it creates burden when the app changes.

Could just those py files be distributed in the template (possibly in
some devel packages, but they aren't exceptionally big), but the code be
kept in dom0? That would neccessitate creation of some resonably stable
API, which I think is still easier.

regards, .-.
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Feb 29, 2016

Member

On Mon, Feb 29, 2016 at 12:52:13PM -0800, Wojtek Porczyk wrote:

I was thinking about just that, endpoint in this egg-info thingy.

I think this one applies:
https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins

Or package in VM part of the application (some subpackage probably).

Could just those py files be distributed in the template (possibly in
some devel packages, but they aren't exceptionally big), but the code be
kept in dom0? That would neccessitate creation of some resonably stable
API, which I think is still easier.

Yep, some stable API for test dom0-VM communication IMO isn't a problem.
In case of some differences, it may simply throw "skip" result.

So I think for the VM part (which in fact applies mostly to Thunderbird
tests here, as direct split-gpg calls doesn't require any additional
files there) we have final solution - have it in some subpackage
installable in the VM (template), together with its dependencies
(python-dogtail).

The remaining problem is how to handle dom0 part. The one point I've
missed above is core API. core2 (R3.0, R3.1) requires slightly different
test than core3 (R4.0). This is the main reason why I've put it into
core-admin repository... The beauty of app-linux-split-gpg component
(and in fact all of app-*) is that they all works on any Qubes version,
exactly the same code (in "master" branch). Introducing plugins using
dom0 core API may break that property (no, I'd not assume the "core3"
will be the ultimate API, stable to the end). And I want to
be able to run such tests also on R3.0 and R3.1 (at least as long as
they are supported).

There are probably many solutions for this, but the best I can think of
is to have universal test there - something that will detect core API
version and act accordingly. API usage is there quite minimal (create a
VM, then a bunch of vm.run calls), so this should be quite easy.
Probably will simply require a separate setUp functions, at least to
handle core2 and core3 at the same time.
Then design the test loading API so that it detects with which core API
versions is compatible (and throw "skip" result in case of incompatible
tests - not silently skip them). This part of the "test loading API"
may be simply some obligatory core API version check at the beginning of
such external test.

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Member

marmarek commented Feb 29, 2016

On Mon, Feb 29, 2016 at 12:52:13PM -0800, Wojtek Porczyk wrote:

I was thinking about just that, endpoint in this egg-info thingy.

I think this one applies:
https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins

Or package in VM part of the application (some subpackage probably).

Could just those py files be distributed in the template (possibly in
some devel packages, but they aren't exceptionally big), but the code be
kept in dom0? That would neccessitate creation of some resonably stable
API, which I think is still easier.

Yep, some stable API for test dom0-VM communication IMO isn't a problem.
In case of some differences, it may simply throw "skip" result.

So I think for the VM part (which in fact applies mostly to Thunderbird
tests here, as direct split-gpg calls doesn't require any additional
files there) we have final solution - have it in some subpackage
installable in the VM (template), together with its dependencies
(python-dogtail).

The remaining problem is how to handle dom0 part. The one point I've
missed above is core API. core2 (R3.0, R3.1) requires slightly different
test than core3 (R4.0). This is the main reason why I've put it into
core-admin repository... The beauty of app-linux-split-gpg component
(and in fact all of app-*) is that they all works on any Qubes version,
exactly the same code (in "master" branch). Introducing plugins using
dom0 core API may break that property (no, I'd not assume the "core3"
will be the ultimate API, stable to the end). And I want to
be able to run such tests also on R3.0 and R3.1 (at least as long as
they are supported).

There are probably many solutions for this, but the best I can think of
is to have universal test there - something that will detect core API
version and act accordingly. API usage is there quite minimal (create a
VM, then a bunch of vm.run calls), so this should be quite easy.
Probably will simply require a separate setUp functions, at least to
handle core2 and core3 at the same time.
Then design the test loading API so that it detects with which core API
versions is compatible (and throw "skip" result in case of incompatible
tests - not silently skip them). This part of the "test loading API"
may be simply some obligatory core API version check at the beginning of
such external test.

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

@woju

This comment has been minimized.

Show comment
Hide comment
@woju

woju Feb 29, 2016

Member

On Mon, Feb 29, 2016 at 01:58:56PM -0800, Marek Marczykowski-Górecki wrote:

On Mon, Feb 29, 2016 at 12:52:13PM -0800, Wojtek Porczyk wrote:

I was thinking about just that, endpoint in this egg-info thingy.

I think this one applies:
https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins

Yes, that's the one. It is configured with entry_points keyword argument
to setup():
https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins

Or package in VM part of the application (some subpackage probably).

Could just those py files be distributed in the template (possibly in
some devel packages, but they aren't exceptionally big), but the code be
kept in dom0? That would neccessitate creation of some resonably stable
API, which I think is still easier.

Yep, some stable API for test dom0-VM communication IMO isn't a problem.
In case of some differences, it may simply throw "skip" result.

So I think for the VM part (which in fact applies mostly to Thunderbird
tests here, as direct split-gpg calls doesn't require any additional
files there) we have final solution - have it in some subpackage
installable in the VM (template), together with its dependencies
(python-dogtail).

The remaining problem is how to handle dom0 part. The one point I've
missed above is core API. core2 (R3.0, R3.1) requires slightly different
test than core3 (R4.0). This is the main reason why I've put it into
core-admin repository... The beauty of app-linux-split-gpg component
(and in fact all of app-*) is that they all works on any Qubes version,
exactly the same code (in "master" branch). Introducing plugins using
dom0 core API may break that property

(no, I'd not assume the "core3"
will be the ultimate API, stable to the end).

I wouldn't dare to suggest that. :)

And I want to be able to run such tests also on R3.0 and R3.1 (at
least as long as they are supported).

Core2 doesn't use setuptools. It should however be able to import
plugins from other packages, however it wouldn't be able to provide its
own plugins to fit this model. That may or may not hurt.

There are probably many solutions for this, but the best I can think of
is to have universal test there - something that will detect core API
version and act accordingly. API usage is there quite minimal (create a
VM, then a bunch of vm.run calls), so this should be quite easy.
Probably will simply require a separate setUp functions, at least to
handle core2 and core3 at the same time.
Then design the test loading API so that it detects with which core API
versions is compatible (and throw "skip" result in case of incompatible
tests - not silently skip them). This part of the "test loading API"
may be simply some obligatory core API version check at the beginning of
such external test.

Python's unittest provides loading protocol:
https://docs.python.org/2.7/library/unittest.html#load-tests-protocol.
There should be one proxy module, which instead of loading its own
testcases, would import testcases from the plugins. If we could
constrain the scope of this mechanism, we could make some simple API for
those testcases.

For example: lets suppose that this thing is intended only for testing
qrexec apps which need two vms, one for client and one for server. The
loader would take the class provided by plugin and mix it with its own,
core-dependent mixin, which would provide the test_ methods with
self.vm_server and self.vm_client. Then those tests would invoke .run()
on those vms (the API to vm objects didn't change much). At any time the
test case may invoke self.skip(), for whatever reason, but often in
idioms like

try:
vm.some_core_dependent_function(or_, core, dependent, params)
except (AttributeError, TypeError):
self.skip('core API mismatch')

There should be also some provision for setting up qrexec policy,
possibly through that mixin, like self.qrexec_policy(rpcname), which
would put an allow rule from client to server.

Would that be enough?

regards, .-.
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>

Member

woju commented Feb 29, 2016

On Mon, Feb 29, 2016 at 01:58:56PM -0800, Marek Marczykowski-Górecki wrote:

On Mon, Feb 29, 2016 at 12:52:13PM -0800, Wojtek Porczyk wrote:

I was thinking about just that, endpoint in this egg-info thingy.

I think this one applies:
https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins

Yes, that's the one. It is configured with entry_points keyword argument
to setup():
https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins

Or package in VM part of the application (some subpackage probably).

Could just those py files be distributed in the template (possibly in
some devel packages, but they aren't exceptionally big), but the code be
kept in dom0? That would neccessitate creation of some resonably stable
API, which I think is still easier.

Yep, some stable API for test dom0-VM communication IMO isn't a problem.
In case of some differences, it may simply throw "skip" result.

So I think for the VM part (which in fact applies mostly to Thunderbird
tests here, as direct split-gpg calls doesn't require any additional
files there) we have final solution - have it in some subpackage
installable in the VM (template), together with its dependencies
(python-dogtail).

The remaining problem is how to handle dom0 part. The one point I've
missed above is core API. core2 (R3.0, R3.1) requires slightly different
test than core3 (R4.0). This is the main reason why I've put it into
core-admin repository... The beauty of app-linux-split-gpg component
(and in fact all of app-*) is that they all works on any Qubes version,
exactly the same code (in "master" branch). Introducing plugins using
dom0 core API may break that property

(no, I'd not assume the "core3"
will be the ultimate API, stable to the end).

I wouldn't dare to suggest that. :)

And I want to be able to run such tests also on R3.0 and R3.1 (at
least as long as they are supported).

Core2 doesn't use setuptools. It should however be able to import
plugins from other packages, however it wouldn't be able to provide its
own plugins to fit this model. That may or may not hurt.

There are probably many solutions for this, but the best I can think of
is to have universal test there - something that will detect core API
version and act accordingly. API usage is there quite minimal (create a
VM, then a bunch of vm.run calls), so this should be quite easy.
Probably will simply require a separate setUp functions, at least to
handle core2 and core3 at the same time.
Then design the test loading API so that it detects with which core API
versions is compatible (and throw "skip" result in case of incompatible
tests - not silently skip them). This part of the "test loading API"
may be simply some obligatory core API version check at the beginning of
such external test.

Python's unittest provides loading protocol:
https://docs.python.org/2.7/library/unittest.html#load-tests-protocol.
There should be one proxy module, which instead of loading its own
testcases, would import testcases from the plugins. If we could
constrain the scope of this mechanism, we could make some simple API for
those testcases.

For example: lets suppose that this thing is intended only for testing
qrexec apps which need two vms, one for client and one for server. The
loader would take the class provided by plugin and mix it with its own,
core-dependent mixin, which would provide the test_ methods with
self.vm_server and self.vm_client. Then those tests would invoke .run()
on those vms (the API to vm objects didn't change much). At any time the
test case may invoke self.skip(), for whatever reason, but often in
idioms like

try:
vm.some_core_dependent_function(or_, core, dependent, params)
except (AttributeError, TypeError):
self.skip('core API mismatch')

There should be also some provision for setting up qrexec policy,
possibly through that mixin, like self.qrexec_policy(rpcname), which
would put an allow rule from client to server.

Would that be enough?

regards, .-.
Wojtek Porczyk .-^' '^-.
Invisible Things Lab |'-.-^-.-'|
| | | |
I do not fear computers, | '-.-' |
I fear lack of them. '-._ : ,-'
-- Isaac Asimov `^-^-_>

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Feb 29, 2016

Member

On Mon, Feb 29, 2016 at 02:25:13PM -0800, Wojtek Porczyk wrote:

On Mon, Feb 29, 2016 at 01:58:56PM -0800, Marek Marczykowski-Górecki wrote:

On Mon, Feb 29, 2016 at 12:52:13PM -0800, Wojtek Porczyk wrote:

I was thinking about just that, endpoint in this egg-info thingy.

I think this one applies:
https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins

Yes, that's the one. It is configured with entry_points keyword argument
to setup():
https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins

Looks good.

Python's unittest provides loading protocol:
https://docs.python.org/2.7/library/unittest.html#load-tests-protocol.
There should be one proxy module, which instead of loading its own
testcases, would import testcases from the plugins.

Yes.

Would that be enough?

Something like this, yes. I don't know if "two VMs model" is enough for
such tests (sometimes it may be necessary to setup network in some
particular way, for example). But I think, in worst case it can be
solved using try/except like you posted.

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Member

marmarek commented Feb 29, 2016

On Mon, Feb 29, 2016 at 02:25:13PM -0800, Wojtek Porczyk wrote:

On Mon, Feb 29, 2016 at 01:58:56PM -0800, Marek Marczykowski-Górecki wrote:

On Mon, Feb 29, 2016 at 12:52:13PM -0800, Wojtek Porczyk wrote:

I was thinking about just that, endpoint in this egg-info thingy.

I think this one applies:
https://pythonhosted.org/setuptools/pkg_resources.html#locating-plugins

Yes, that's the one. It is configured with entry_points keyword argument
to setup():
https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins

Looks good.

Python's unittest provides loading protocol:
https://docs.python.org/2.7/library/unittest.html#load-tests-protocol.
There should be one proxy module, which instead of loading its own
testcases, would import testcases from the plugins.

Yes.

Would that be enough?

Something like this, yes. I don't know if "two VMs model" is enough for
such tests (sometimes it may be necessary to setup network in some
particular way, for example). But I think, in worst case it can be
solved using try/except like you posted.

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

marmarek added a commit to marmarek/qubes-app-linux-split-gpg that referenced this issue Mar 24, 2016

tests: enable network access for test VMs
Required to install enigmail for example.

QubesOS/qubes-issues#1368

marmarek added a commit to marmarek/qubes-app-linux-split-gpg that referenced this issue Mar 24, 2016

tests: fix qrexec policy setting
Fix order of parameters. Also setup qubes.GpgImportKey.

QubesOS/qubes-issues#1368

marmarek added a commit to marmarek/qubes-app-linux-split-gpg that referenced this issue Mar 24, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 24, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc21 has been pushed to the r3.1 testing repository for the Fedora fc21 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.1-current-testing

Changes included in this update

Member

marmarek commented Mar 24, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc21 has been pushed to the r3.1 testing repository for the Fedora fc21 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.1-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 24, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc22 has been pushed to the r3.1 testing repository for the Fedora fc22 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.1-current-testing

Changes included in this update

Member

marmarek commented Mar 24, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc22 has been pushed to the r3.1 testing repository for the Fedora fc22 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.1-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 24, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc23 has been pushed to the r3.1 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.1-current-testing

Changes included in this update

Member

marmarek commented Mar 24, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc23 has been pushed to the r3.1 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.1-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 24, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-dom0-2.0.19-1.fc20 has been pushed to the r3.1 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

Member

marmarek commented Mar 24, 2016

Automated announcement from builder-github

The package qubes-gpg-split-dom0-2.0.19-1.fc20 has been pushed to the r3.1 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 24, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb8u1 has been pushed to the r3.1 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Mar 24, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb8u1 has been pushed to the r3.1 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 24, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb9u1 has been pushed to the r3.1 testing repository for the Debian stretch template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing stretch-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Mar 24, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb9u1 has been pushed to the r3.1 testing repository for the Debian stretch template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing stretch-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 24, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb7u1 has been pushed to the r3.1 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Mar 24, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb7u1 has been pushed to the r3.1 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 19, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc21 has been pushed to the r3.1 stable repository for the Fedora fc21 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

Member

marmarek commented Apr 19, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc21 has been pushed to the r3.1 stable repository for the Fedora fc21 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 19, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc22 has been pushed to the r3.1 stable repository for the Fedora fc22 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

Member

marmarek commented Apr 19, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc22 has been pushed to the r3.1 stable repository for the Fedora fc22 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 19, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc23 has been pushed to the r3.1 stable repository for the Fedora fc23 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

Member

marmarek commented Apr 19, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc23 has been pushed to the r3.1 stable repository for the Fedora fc23 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 19, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-dom0-2.0.19-1.fc20 has been pushed to the r3.1 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Member

marmarek commented Apr 19, 2016

Automated announcement from builder-github

The package qubes-gpg-split-dom0-2.0.19-1.fc20 has been pushed to the r3.1 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 19, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb8u1 has been pushed to the r3.1 stable repository for the Debian jessie template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Apr 19, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb8u1 has been pushed to the r3.1 stable repository for the Debian jessie template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 19, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb9u1 has been pushed to the r3.1 stable repository for the Debian stretch template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Apr 19, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb9u1 has been pushed to the r3.1 stable repository for the Debian stretch template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 19, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb7u1 has been pushed to the r3.1 stable repository for the Debian wheezy template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Apr 19, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb7u1 has been pushed to the r3.1 stable repository for the Debian wheezy template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 1, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb8u1 has been pushed to the r3.0 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented May 1, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb8u1 has been pushed to the r3.0 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 1, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb7u1 has been pushed to the r3.0 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented May 1, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.19-1+deb7u1 has been pushed to the r3.0 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 2, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc20 has been pushed to the r3.0 testing repository for the Fedora fc20 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

Member

marmarek commented May 2, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc20 has been pushed to the r3.0 testing repository for the Fedora fc20 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 2, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc21 has been pushed to the r3.0 testing repository for the Fedora fc21 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

Member

marmarek commented May 2, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc21 has been pushed to the r3.0 testing repository for the Fedora fc21 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 2, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc22 has been pushed to the r3.0 testing repository for the Fedora fc22 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

Member

marmarek commented May 2, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc22 has been pushed to the r3.0 testing repository for the Fedora fc22 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 2, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc23 has been pushed to the r3.0 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

Member

marmarek commented May 2, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.19-1.fc23 has been pushed to the r3.0 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 2, 2016

Member

Automated announcement from builder-github

The package qubes-gpg-split-dom0-2.0.19-1.fc20 has been pushed to the r3.0 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

Member

marmarek commented May 2, 2016

Automated announcement from builder-github

The package qubes-gpg-split-dom0-2.0.19-1.fc20 has been pushed to the r3.0 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment