# @name I2C IRQ test
# @desc Check that I2C interrupts increase if there is activity and do not increase if there is no activity
# @requires i2c
# @setup_requires

I2C_S_FUNC_IRQ_I2CDETECT source 'common.sh'; IRQ=`get_irq_for_iface.sh -i 'i2c'` && PRE=`get_num_interrupts_for_irq.sh -i $IRQ -c 0` && run_processes.sh -c "export IRQ=$IRQ && /opt/ltp/runltp -f ddt/i2c_detect -P $PLATFORM -s I2C_S_FUNC_I2CDETECT " && POST=`get_num_interrupts_for_irq.sh -i $IRQ -c 0` && [[ $POST -gt $PRE ]]

I2C_S_FUNC_IRQ_NEG_TEST source 'common.sh';  IRQ=`get_irq_for_iface.sh -i 'i2c'` && PRE=`get_num_interrupts_for_irq.sh -i $IRQ -c 0` && do_cmd sleep 20 && POST=`get_num_interrupts_for_irq.sh -i $IRQ -c 0` && [[ $POST -eq $PRE ]]
