Hi everybody.
I have been playing with cockpit for some time. Now I have a little library that create processes in the backend, which keep running until I stop then, so I start wondering about how to do integration testing with cockpit, ...
In cockpit I have these constraints:
- cockpit.js is served by cockpit-ws, - A pam session is created when user login on web interface,
At the most what I have is some function calls that have side effects on backend. My testing would be checking for these side effects on the backend, like checking if some process started, or finished, or if some file was created, or if a database table was populated.. Usually we would execute tests over nodejs but I don't now how to deal with pam session ...
Cheers, Daniel
On 24.05.2018 21:24, Daniel Hilst Selli wrote:
Hi everybody.
I have been playing with cockpit for some time. Now I have a little library that create processes in the backend, which keep running until I stop then, so I start wondering about how to do integration testing with cockpit, ...
In cockpit I have these constraints:
- cockpit.js is served by cockpit-ws,
- A pam session is created when user login on web interface,
At the most what I have is some function calls that have side effects on backend. My testing would be checking for these side effects on the backend, like checking if some process started, or finished, or if some file was created, or if a database table was populated.. Usually we would execute tests over nodejs but I don't now how to deal with pam session ...
The Cockpit starter-kit has lots of work in it for doing CI with Cockpit plugins and code.
Does it help:
https://github.com/cockpit-project/starter-kit
See the documentation:
https://cockpit-project.org/blog/cockpit-starter-kit.html
https://cockpit-project.org/blog/cockpit-custom-test-framework.html
Cheers,
Stef
Hello Daniel,
sorry for the late reply!
Daniel Hilst Selli [2018-05-24 16:24 -0300]:
I have been playing with cockpit for some time. Now I have a little library that create processes in the backend, which keep running until I stop then, so I start wondering about how to do integration testing with cockpit, ...
In cockpit I have these constraints:
- cockpit.js is served by cockpit-ws,
- A pam session is created when user login on web interface,
At the most what I have is some function calls that have side effects on backend. My testing would be checking for these side effects on the backend, like checking if some process started, or finished, or if some file was created, or if a database table was populated.. Usually we would execute tests over nodejs but I don't now how to deal with pam session ...
I'm afraid I don't fully follow what you mean above. But if you just need to set up cockpit to avoid the login page and the PAM, you can configure ws to use the "cockpit-stub" negotiation (i. e. none at all). E. g. welder-web does that for its testing:
https://github.com/weldr/welder-web/blob/master/Dockerfile.cockpit#L8
The main itch here that this is being shipped by the cockpit-kubernetes package, so you need to install that (and its dependencies).
Martin
Hi Martin, thanks for the reply!! This will help me too!!!! Also I was wondering how to add a machine to cockpit dashborad programmatically. I think there is a thread for that, I will look for it!
Em 17/06/2018 10:31 AM, "Martin Pitt" martin@piware.de escreveu:
Hello Daniel,
sorry for the late reply!
Daniel Hilst Selli [2018-05-24 16:24 -0300]:
I have been playing with cockpit for some time. Now I have a little
library that
create processes in the backend, which keep running until I stop then, so
I
start wondering about how to do integration testing with cockpit, ...
In cockpit I have these constraints:
- cockpit.js is served by cockpit-ws,
- A pam session is created when user login on web interface,
At the most what I have is some function calls that have side effects on backend. My testing would be checking for these side effects on the
backend,
like checking if some process started, or finished, or if some file was
created,
or if a database table was populated.. Usually we would execute tests over nodejs but I don't now how to deal with pam session ...
I'm afraid I don't fully follow what you mean above. But if you just need to set up cockpit to avoid the login page and the PAM, you can configure ws to use the "cockpit-stub" negotiation (i. e. none at all). E. g. welder-web does that for its testing:
https://github.com/weldr/welder-web/blob/master/Dockerfile.cockpit#L8
The main itch here that this is being shipped by the cockpit-kubernetes package, so you need to install that (and its dependencies).
Martin
_______________________________________________ cockpit-devel mailing list -- cockpit-devel@lists.fedorahosted.org To unsubscribe send an email to cockpit-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/cockpit-devel@lists.fedorahost...
Hello Daniel,
Daniel. [2018-06-17 22:26 -0300]:
Hi Martin, thanks for the reply!! This will help me too!!!! Also I was wondering how to add a machine to cockpit dashborad programmatically.
https://cockpit-project.org/guide/latest/feature-machines.html
Martin
cockpit-devel@lists.fedorahosted.org