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

GlobaLeaks testing client for development #4

Closed
fpietrosanti opened this issue Oct 16, 2012 · 5 comments
Closed

GlobaLeaks testing client for development #4

fpietrosanti opened this issue Oct 16, 2012 · 5 comments

Comments

@fpietrosanti
Copy link
Contributor

After the recent refactoring the methods used by curtreg to generate the requests for use by emulating a globaleaks client from command line stopped working.

A Globaleaks client making request and automation is required to facilitate testing regardless of the availability of full globaleaks client interfaces and rest implementation.

The goal of the client is to facilitate the development.

Requirements:

  • it must be quick to be used and developed
  • it must be hackish for very quick modification
  • it must be commandline to provide easy scripting (es: first do submission, the add files, then finalize, then come back with receipt to access tip, then a receiver access it, etc)

We do not need this client for:

  • performance testing
  • automated fuzzing

So, we now have 3 options:

  • Python curtreg refactoring
    This probably means changing the logic to hard-code data in the request.
  • Scripting with cmdline tools
    Make scripting with command line tools such as curl or other pythonic cmdnline script like https://github.com/jkbr/httpie#json

Testing RESTful API with httpie
http://blogs.operationaldynamics.com/andrew/software/research/testing-restful-apis-with-httpie

Testing RESTFul API with curl/wget
http://blogs.operationaldynamics.com/andrew/software/research/testing-rest-the-hard-way

  • Javascript client
    Javascript client can be executed from command line with phantomjs.

It can be automated with jasmine (below example of REST testing with jasmine:
http://blog.founddrama.net/2012/09/headless-javascript-testing-with-jasmine-and-phantomjs/
http://stackoverflow.com/questions/11429332/unit-tests-of-node-js-rest-services-with-mocha-or-jasmine
http://brianstoner.com/blog/testing-in-nodejs-with-mocha/

@fpietrosanti
Copy link
Contributor Author

cc @hellais @vecna

@fpietrosanti
Copy link
Contributor Author

Following a chat on possible point "3":

In GLClient/www/js/app/requests/ there are the following files:
node.js status.js submission.js

those are the data structure used by GLClient, directly specifying json objects.
Those make XHR requests trough latenza (What is latenza, what it exactly does?) to the RESTful query.

They get back object *.done() .
How complex is to make a test submission example with jasmine+phantomjs+GLClient structures?

@vecna
Copy link
Contributor

vecna commented Oct 17, 2012

We do not need this client to perform performances testing, but almost parallel requests need to be performed freely. actually I don't know how's the Storm behavior with parallels request.

@fpietrosanti
Copy link
Contributor Author

Yeah, but in any case that's a one off testing not part of the script itself.

It can be done with:
for i in seq 1 100 ; do (./script-of-testing $server )&; done

@fpietrosanti
Copy link
Contributor Author

We are now using GLClient UI and unit-testing following a user-driven functional testing to reach a minimal alpha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants