@@ -0,0 +1,1958 @@
+# -*- coding: utf-8 -*-%0A# Copyright 2021-present ScyllaDB%0A#%0A# This file is part of Scylla.%0A#%0A# Scylla is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU Affero General Public License as published by%0A# the Free Software Foundation, either version 3 of the License, or%0A# (at your option) any later version.%0A#%0A# Scylla is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A# GNU General Public License for more details.%0A#%0A# You should have received a copy of the GNU Affero General Public License%0A# along with Scylla.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A%0Aimport pytest%0Aimport util%0Aimport nodetool%0A%0Adef test_snapshots_table(scylla_only, cql, test_keyspace):%0A    with util.new_test_table(cql, test_keyspace, 'pk int PRIMARY KEY, v int') as table:%0A        cql.execute(f%22INSERT INTO %7Btable%7D (pk, v) VALUES (0, 0)%22)%0A        nodetool.take_snapshot(cql, table, 'my_tag', False)%0A        res = list(cql.execute(f%22SELECT keyspace_name, table_name, snapshot_name, live, total FROM system.snapshots%22))%0A        assert len(res) == 1%0A        ks, tbl = table.split('.')%0A        assert res%5B0%5D%5B0%5D == ks%0A        assert res%5B0%5D%5B1%5D == tbl%0A        assert res%5B0%5D%5B2%5D == 'my_tag'%0A%0A# We only want to check that the table exists with the listed columns, to assert%0A# backwards compatibility.%0Adef _check_exists(cql, table_name, columns):%0A    cols = %22, %22.join(columns)%0A    assert list(cql.execute(f%22SELECT %7Bcols%7D FROM system.%7Btable_name%7D%22))%0A%0Adef test_protocol_servers(scylla_only, cql):%0A    _check_exists(cql, %22protocol_servers%22, (%22name%22, %22listen_addresses%22, %22protocol%22, %22protocol_version%22))%0A%0Adef test_runtime_info(scylla_only, cql):%0A    _check_exists(cql, %22runtime_info%22, (%22group%22, %22item%22, %22value%22))%0A%0Adef test_versions(scylla_only, cql):%0A    _check_exists(cql, %22versions%22, (%22key%22, %22build_id%22, %22build_mode%22, %22version%22))%0A

add virtual_tables.py