53 lines
1.8 KiB
Python
Executable File
53 lines
1.8 KiB
Python
Executable File
#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv)
|
|
|
|
# This file is part of Cockpit.
|
|
#
|
|
# Copyright (C) 2015 Red Hat, Inc.
|
|
#
|
|
# Cockpit is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Cockpit is distributed in the hope that it will be useful, but
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
# Lesser General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
# along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
from storagelib import StorageCase
|
|
from testlib import test_main
|
|
|
|
|
|
class TestStorageRaid1(StorageCase):
|
|
|
|
def testRaidLevelOne(self):
|
|
m = self.machine
|
|
b = self.browser
|
|
|
|
self.login_and_go("/storage")
|
|
|
|
# Add four two and make a RAID out of them
|
|
m.add_disk("50M", serial="DISK1")
|
|
m.add_disk("50M", serial="DISK2")
|
|
b.wait_in_text("#drives", "DISK1")
|
|
b.wait_in_text("#drives", "DISK2")
|
|
|
|
self.devices_dropdown('Create RAID device')
|
|
self.dialog_wait_open()
|
|
# No swap block devices should show up
|
|
b.wait_not_in_text("#dialog .pf-v5-c-data-list", "zram")
|
|
self.dialog_set_val("level", "raid1")
|
|
self.dialog_set_val("disks", {"DISK1": True, "DISK2": True})
|
|
self.dialog_set_val("name", "SOMERAID")
|
|
# The dialog should make sure that the Chunk size is ignored (has to be 0 for RAID 1)
|
|
self.dialog_apply()
|
|
self.dialog_wait_close()
|
|
b.wait_in_text("#devices", "SOMERAID")
|
|
|
|
|
|
if __name__ == '__main__':
|
|
test_main()
|