Beispiel #1
0
def test_document_rc_status_wrong_no_replicas(rc_document):
    del rc_document['spec']['replicas']
    status = diagnostics._document_rc_status(rc_document)
    assert 'Wrong replication controller document' in status['reason']
    assert status['status'] is False
Beispiel #2
0
def test_document_rc_status_too_many_replicas(rc_document):
    rc_document['status']['replicas'] = 2
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == 'Current pods 2, desired 1'
    assert status['status'] is False
Beispiel #3
0
def test_document_rc_status_wrong_replicaset(rc_document):
    rc_document['spec']['replicas'] = 2
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == 'Current pods 1, desired 2'
    assert status['status'] is False
Beispiel #4
0
def test_document_rc_status_ok(rc_document):
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == ''
    assert status['status'] is True
Beispiel #5
0
def test_document_rc_status_missing_replicas(rc_document):
    rc_document['status']['replicas'] = 0
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == 'Current pods 0, desired 1'
    assert status['status'] is False
def test_document_rc_status_wrong_no_replicas(rc_document):
    del rc_document['spec']['replicas']
    status = diagnostics._document_rc_status(rc_document)
    assert 'Wrong replication controller document' in status['reason']
    assert status['status'] is False
def test_document_rc_status_wrong_replicaset(rc_document):
    rc_document['spec']['replicas'] = 2
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == 'Current pods 1, desired 2'
    assert status['status'] is False
def test_document_rc_status_too_many_replicas(rc_document):
    rc_document['status']['replicas'] = 2
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == 'Current pods 2, desired 1'
    assert status['status'] is False
def test_document_rc_status_missing_replicas(rc_document):
    rc_document['status']['replicas'] = 0
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == 'Current pods 0, desired 1'
    assert status['status'] is False
def test_document_rc_status_ok(rc_document):
    status = diagnostics._document_rc_status(rc_document)
    assert status['reason'] == ''
    assert status['status'] is True