• Cyrill Gorcunov's avatar
    zdtm: fifo-rowo-pair test update · 7ff9efda
    Cyrill Gorcunov authored
    Address Andrew's comments
    
     - use TEST_VALUE macro instead of open coded value
     - use WIFx macros for child status testing
     - kill child/parent on error
    
    Note that it was not clear from an initiall patch
    change log -- the difference between fifo_wronly
    test case and this one is that we use fork() call
    here which allow us to make sure that fifo restoration
    code logic will be tested more widely.
    
    Basically the flowchart of the test case:
    
    parent				child
    ------				-----
    open RW fifo (slave)
    open RO fifo (master)
    				open WO fifo (master)
    				dup parent slave to slave1
    
    				... waiting c/r to happen ...
    				... waking up from c/r ...
    
    				send bytes to master
    				send bytes to slave1
    
    				finish
    ... initiating c/r ...
    ... waking up from c/r ...
    
    read bytes from master
    read bytes from slave
    
    PASS :D
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    7ff9efda
fifo-rowo-pair.c 3.04 KB