-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 23.02.2013 15:29, schrieb Jan Kiszka: > On 2013-02-23 15:08, Andreas Färber wrote: >> Am 23.02.2013 15:02, schrieb Jan Kiszka: >>> Will address the QOM changes, but I need to check back with >>> $customer regarding test suite efforts. >> >> Thanks. My concern here is in particular that this device is not >> added to any machine, so it gets no implicit testing. Nor does >> the commit message or cover letter specify with which command >> line and guest it has been tested. > > The device is target-agnostic, naturally. We use it with > versatilepb. > >> Whether all code paths actually get test coverage is less >> relevant to me than a smoke test to assure my QOM refactorings >> don't break anything. :) > > Even that is not trivial. Unless something in the guest actively > pokes the device, nothing will happen. > > To make a useful basic test, you need to enable the device in the > guest (echo <type> <addr> > /sys/bus/i2c/devices/i2c-0/new_device), > read from it (/sys/.../eeprom) and compare the result against the > expected content. Writing/write-protection tests would make some > sense, too. > > I will have to look closer at what the test infrastructure provides > in this regard - and if the target kernel is already supporting > AT24.
qtest does not use any Linux kernel at all, instead it uses direct PIO/MMIO wrapped in libqos helper functions. You can directly initiate transfers to the device at address X and assert that the received data matches your expectations. E.g., reading zero data or writing some 0x42 test data and reading it back. Cf. tests/tmp105-test.c. Andreas - -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJRKNTNAAoJEPou0S0+fgE/mXIP/2ArmeqypMINOZgrEpNjVwxE HT8nQFA760nkfggZtHWNsmsZ2Gr3Jr1SvprO4UhXUkh5xAsDfKScastZMa8zPoyC X5OIOyTnwLj5DORHmGkkyQ1VDlv0QQWzTsKh/Q1uY9ZXBya8GvmcRRlysmEHShIF 3dlyl1rvIjxb3i6nTATcI+E29rmQulnnojoQWaKEGR5UVdjikQ/70RWo5aiWx0r0 CFXetefg6+/nvqQfwBFnXjZdTTNuokb38bAm3/X6BQILMQJKWPxMCdvnlYAqgliv Zh4F5+ec8wpfVc+D0/FAwtq9/40v4wQ7Vr/q9UPLvsJxLeRiHJuXr/WrxSx41T2H ra4QUHQZZSpxSfdzx0OeZf8VlVHiOcyLkbQuiQ38VN19k3IqCU1cKYuajADKB6po HumlHLYYe5tfG2psFiXVTTRpg1BRHJwRJxO0v6sJx3WpaYCkGpogkOBxlo77xeS2 r3OqiQb18nVavnV2ygrOhvccgt0RHM/j0bSZsALsF4PZ6JaWkZdN5n+pcKvpuVJm msOXSiHSVAdiUbWfQmm7XKL6aqqnB5tHeQ7Rih0HY3S5/ttb9i8EsnCrVBfG6VlC FrFSt2nfMWHU929Mvlrr1GKBm723AOl7XMuXUdG0e2PbCQmKmwS3OKYgC/7cm3Z4 CTlni3quN8oXBz7ykt57 =rHB5 -----END PGP SIGNATURE-----