ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Difference between normal environment and atf-run



Hi folks,

[Please keep me on CC I'm not subscribed to this list]

I'm currently working on a test suite for a device-maper driver based on a 
RUMP. I have created test in /usr/tests/dev/dm which does something like this

        dict_in  = 
prop_dictionary_internalize_from_file("dm_version_cmd.plist");
        dict_out = prop_dictionary_create();
        
        prop_dictionary_externalize_to_pref(dict_in, &prefp);
        
        error = rump_sys_ioctl(fd, NETBSD_DM_IOCTL, &prefp);
        if (error < 0)
                err(1, "Dm control ioctl failed");

If I run this code in my shell everything works just fine.

[haad@ dm]$ ./h_dm                                                              
                                           
WARNING: 1 error while detecting hardware; check system log.
[haad@ dm]$ echo $? 
0

But if I run atf-run to test whole test program I will got ENOMEM from 
rump_sys_ioctl which is weird.

tc-so:Executing command [ /usr/src/tests/dev/dm/h_dm ]
tc-se:Fail: incorrect exit status: 1, expected: 0
tc-se:stdout:
tc-se:WARNING: 1 error while detecting hardware; check system log.
tc-se:
tc-se:stderr:
tc-se:h_dm: Dm control ioctl failed: Cannot allocate memory

If I change prefp to be allocated on heap error change from ENOMEM to EIO do 
you have an idea why atf case behaves differently ?

Regards

Adam.



Home | Main Index | Thread Index | Old Index