source: trunk/integration/test_servers_of_happiness.py

Last change on this file was c4e6ea6, checked in by Itamar Turner-Trauring <itamar@…>, at 2023-07-03T14:55:33Z

Merge remote-tracking branch 'origin/master' into 2916.grid-manager-integration-tests.2

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"""
2Ported to Python 3.
3"""
4
5import sys
6from os.path import join
7from os import environ
8
9from . import util
10
11import pytest_twisted
12
13
14@pytest_twisted.inlineCallbacks
15def test_upload_immutable(reactor, temp_dir, introducer_furl, flog_gatherer, storage_nodes, request):
16
17    edna = yield util._create_node(
18        reactor, request, temp_dir, introducer_furl, flog_gatherer, "edna",
19        web_port="tcp:9983:interface=localhost",
20        storage=False,
21        needed=3,
22        happy=7,
23        total=10,
24    )
25    yield util.await_client_ready(edna)
26
27    node_dir = join(temp_dir, 'edna')
28
29    # upload a file, which should fail because we have don't have 7
30    # storage servers (but happiness is set to 7)
31    proto = util._CollectOutputProtocol()
32    reactor.spawnProcess(
33        proto,
34        sys.executable,
35        [
36            sys.executable, '-b', '-m', 'allmydata.scripts.runner',
37            '-d', node_dir,
38            'put', __file__,
39        ],
40        env=environ,
41    )
42    try:
43        yield proto.done
44        assert False, "should raise exception"
45    except util.ProcessFailed as e:
46        assert b"UploadUnhappinessError" in e.output
47
48    output = proto.output.getvalue()
49    assert b"shares could be placed on only" in output
Note: See TracBrowser for help on using the repository browser.