0

We are installing a nextcloud server in my organization and i would like to load test it before we deploy more broadly.

I have managed to do some testing with jmeter...(see answer below)

Now i would like to load test other features of nextcloud. I have found this repo but it seems it is not updated anymore : https://github.com/owncloud/smashbox Anyone know if it is still working? (i dont have yet access to the nexcloud server os).

Apparently smashbox is designed for owncloud and not nextcloud...any hint on tools for nextcloud?

Thank you

2 Answers2

0

If you "dont have yet access to the nexcloud server" then how do you know that "doesnt log in with http authorization manager"?

Whatever. Given Nextcloud doesn't ask your credentials most probably it's configured for Single-Sign-On and most probably it's Kerberos

If this is the case you will need to not only to add the HTTP Authorization Manager but also perform the relevant configuration in krb5.conf and jaas.conf files (live in "bin" folder of your JMeter installation).

You can check out Windows Authentication with Apache JMeter article for example setup and more comprehensive explanations.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I mean i dont have access to the configuration of the server... I have configured the post request in jmeter (http authorization manager is already installed) to login but i cant generate the requesttoken parameter... –  Jul 13 '22 at 15:31
  • Then it might be the case for simple [correlation](https://www.blazemeter.com/blog/correlation-in-jmeter): i.e. you make a first [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request to the login page, extract the `requesttoken` using a suitable [Post-Processor](https://jmeter.apache.org/usermanual/component_reference.html#postprocessors) and use the [JMeter Variable](https://jmeter.apache.org/usermanual/functions.html) generated by the Post-Processor as the value for the `requesttoken` parameter for the next POST request – Dmitri T Jul 13 '22 at 18:46
  • Yes that's what i just did, but i end up with an unauthorized response –  Jul 13 '22 at 19:16
  • i'm thinking it's a cookie issue ... see here https://stackoverflow.com/questions/72971878/how-to-pass-cookie-to-jmeter-post-request –  Jul 13 '22 at 19:58
  • Im trying to pass the cookie set by my first thread group the the second. it's working as i see it in debug sampler variables output but the cookie is not set in post request. so i try to set it in the header, but the variable is not parsed in the header manager.... i dont understand why they dont do something more simple in jmeter code to pass csrf tokens! –  Jul 13 '22 at 20:50
  • I don't understand why do you need two thread groups – Dmitri T Jul 14 '22 at 05:13
  • it works in the same group, thanks! –  Jul 14 '22 at 08:30
0

So here is the answer :

You have to create two sampler http request. the first request is a get request on the login page. the second request is a post request on the login page.

You have to create a regular expression extractor to extract data-requesttoken:

data-requesttoken="(.+)"

You can reuse it in the post request (name : requesttoken) with the variable set in the extractor. You also need to add a http cookie manager to the thread group and leave it blank so it handles the cookies set in the get request and in the post request.

Then the login works properly and you can tune in the loop, number of threads and ramp up

There is only one problem on my machine: the request randomly succeed or fail because the cookie manager sometimes set the proper cookies in the redirect after post request and sometimes not... (see here : JMeter randomly setting proper cookies so my request succeed )