def _wipe(dev):
    endres = 0
    dev = _devbase(dev)

    size, block, discard = _sizes(dev)

    if discard is None:
        log.error('Unable to read SysFS props for {0}'.format(dev))
        return None
    elif not discard:
        log.warning('{0} seems unable to discard'.format(dev))
        wiper = 'dd'
    elif not HAS_BLKDISCARD:
        log.warning('blkdiscard binary not available, properly wipe the dev manually for optimal results')
        wiper = 'dd'
    else:
        wiper = 'blkdiscard'

    wipe_failmsg = 'Error wiping {0}: {{0}}'.format(dev)
    if wiper == 'dd':
        blocks = 4
        cmd = 'dd if=/dev/zero of=/dev/{0} bs=1M count={1}'.format(dev, blocks)
        endres += _run_all(cmd, 'warn', wipe_failmsg)

        # Some stuff (<cough>GPT</cough>) writes stuff at the end of a dev as well
        cmd += ' seek={0}'.format((size/1024**2) - blocks)
        endres += _run_all(cmd, 'warn', wipe_failmsg)

    elif wiper == 'blkdiscard':
        cmd = 'blkdiscard /dev/{0}'.format(dev)
        endres += _run_all(cmd, 'warn', wipe_failmsg)
        # TODO: FUCKING annoying bug failing blkdiscard by trying to discard 1 sector past blkdev
        endres = 1

    return endres > 0
Run testify, return True on success, False on failure.
dataset/ETHPy150Open saltstack/salt/salt/modules/bcache.py/_wipe--crossover with--dataset/ETHPy150Open Yelp/Testify/testify/test_program.py/TestProgram.run