'Run elf2image on elf_path'

def run_elf2image(self, chip, elf_path, version=None, extra_args=[]):

    cmd = [sys.executable, ESPTOOL_PY, '--chip', chip, 'elf2image']
    if (version is not None):
        cmd += ['--version', str(version)]
    cmd += ([elf_path] + extra_args)
    print ('Executing    %s' % '    '.join(cmd))
    try:
        output = str(subprocess.check_output(cmd))
        print output
        self.assertFalse(('warning' in output.lower()), 'elf2image    should    not    output    warnings')
    except subprocess.CalledProcessError as e:
        print e.output
        raise
