Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
tbzatek committed Jan 23, 2025
1 parent f0930b5 commit 37eaab1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tests/dbus-tests/test_40_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ def get_drive(self, device):
return drive_object

def setUp(self):
# make sure scsi_debug is not loaded
res, _ = self.run_command('rmmod scsi_debug')
self.assertEqual(res, 1)
# create new fake CD-ROM
# ptype=5 - created device will be CD drive, one new target and host
res, _ = self.run_command('modprobe scsi_debug ptype=5 num_tgts=1 add_host=1')
res, _ = self.run_command('modprobe scsi_debug ptype=5 num_tgts=1 add_host=1 removable=1')
self.assertEqual(res, 0)
self.run_command('udevadm trigger --settle')
self.udev_settle()
Expand Down Expand Up @@ -46,7 +49,8 @@ def tearDown(self):
while os.path.exists(device):
time.sleep(0.1)
self.udev_settle()
self.run_command('modprobe -r scsi_debug')
res, _ = self.run_command('modprobe -r scsi_debug')
self.assertEqual(res, 0)
self.run_command('udevadm trigger --settle')

def test_10_eject(self):
Expand Down Expand Up @@ -96,10 +100,12 @@ def test_40_properties(self):
def read_sys_file(value):
return self.read_file(os.path.join(sys_dir, value)).strip()

print(self.cd_dev)
ret_code, wwn = self.run_command('lsblk -d -no WWN %s' % self.cd_dev)
self.assertEqual(ret_code, 0)

rotational = read_sys_file("block/%s/queue/rotational" % os.path.basename(self.cd_dev))
print(rotational)

res, _ = self.run_command('udisksctl dump')
print (_)
Expand Down

0 comments on commit 37eaab1

Please sign in to comment.