Files
scylladb/test/rest_api/test_system.py
Botond Dénes 686a997c04 Merge 'Complete implementation of configuring IO bandwidth limits' from Pavel Emelyanov
In Scylla there are two options that control IO bandwidth limit -- the /storage_service/(compaction|stream)_throughput REST API endpoints. The endpoints are partially implemented and have no counterparts in the nodetool.

This set implements the missing bits and adds tests for new functionality.

Closes scylladb/scylladb#21877

* github.com:scylladb/scylladb:
  nodetool: Implement [gs]etstreamthroughput commands
  nodetool: Implement [gs]etcompationthroughput commands
  test: Add validation of how IO-updating endpoints work
  api: Implement /storage_service/(stream|compaction)_throughput endpoints
  api: Disqualify const config reference
  api: Implement /storage_service/stream_throughput endpoint
  api: Move stream throughput set/get endpoints from storage service block
  api: Move set_compaction_throughput_mb_per_sec to config block
  util: Include fmt/ranges.h in config_file.hh
2025-01-14 07:56:38 -05:00

35 lines
1.1 KiB
Python

# Copyright 2021-present ScyllaDB
#
# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
import pytest
import requests
def test_system_uptime_ms(rest_api):
resp = rest_api.send('GET', "system/uptime_ms")
resp.raise_for_status()
def test_system_highest_sstable_format(rest_api):
resp = rest_api.send('GET', "system/highest_supported_sstable_version")
resp.raise_for_status()
assert resp.json() == "me"
@pytest.mark.parametrize("params", [
("storage_service/compaction_throughput", "value"),
("storage_service/stream_throughput", "value")
])
def test_io_throughput(rest_api, params):
resp = rest_api.send("POST", params[0], params={ params[1]: 100 })
resp.raise_for_status()
resp = rest_api.send("GET", params[0])
resp.raise_for_status()
assert resp.json() == 100
resp = rest_api.send("POST", params[0], params={ params[1]: 0 })
resp.raise_for_status()
resp = rest_api.send("GET", params[0])
resp.raise_for_status()
assert resp.json() == 0
resp = rest_api.send("POST", params[0])
assert resp.status_code == requests.codes.bad_request