()
| 851 | assert(ret == 0 or ret == -38) |
| 852 | |
| 853 | def test_multi_target_command(): |
| 854 | mds_get_command = {'prefix': 'status', 'format': 'json'} |
| 855 | inbuf = b'' |
| 856 | ret, outbl, outs = cephfs.mds_command('*', json.dumps(mds_get_command), inbuf) |
| 857 | print(outbl) |
| 858 | mds_status = json.loads(outbl) |
| 859 | print(mds_status) |
| 860 | |
| 861 | command = {'prefix': u'session ls', 'format': 'json'} |
| 862 | mds_spec = "*" |
| 863 | inbuf = b'' |
| 864 | |
| 865 | ret, outbl, outs = cephfs.mds_command(mds_spec, json.dumps(command), inbuf) |
| 866 | # Standby MDSs will return -38 |
| 867 | assert(ret == 0 or ret == -38) |
| 868 | print(outbl) |
| 869 | session_map = json.loads(outbl) |
| 870 | |
| 871 | if isinstance(mds_status, list): # if multi target command result |
| 872 | for mds_sessions in session_map: |
| 873 | assert(list(mds_sessions.keys())[0].startswith('mds.')) |
| 874 | |
| 875 | |
| 876 | class TestUnlinkat: |
nothing calls this directly
no test coverage detected