mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* checking  for "config" file existence.
@ 2020-11-12 17:40 Jeffrin Jose T
  2020-11-16 18:32 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffrin Jose T @ 2020-11-12 17:40 UTC (permalink / raw)
  To: Shuah Khan; +Cc: lkml, open list:KERNEL SELFTEST FRAMEWORK

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

hello,

i wrote a  small program to check for the existence of "config" files
for testing projects under kselftest framework.

chmod 755 test_config.py
This file should be located in "tools/testing/selftests"
This can be run as "./test_config.py"



-- 
software engineer
rajagiri school of engineering and technology - autonomous




[-- Attachment #2: test_config.py --]
[-- Type: text/x-python3, Size: 554 bytes --]

#!/usr/bin/python3
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020  RSET

import os
from pathlib import Path

ok = 0
notok = 0
for filename in os.listdir():
    fileall = Path("./"+filename)
    filecheck = Path("./"+filename+"/"+"config")
    if (fileall.is_dir()) and (filename != "kselftest"):
        if filecheck.exists():
            print(filename," [PASS]\n")
            ok = ok + 1 
        else:
            print(filename," [FAIL]\n")
            notok = notok + 1

print(ok+notok,"TESTED") 
print(ok, "PASSED")
print(notok,"FAILED")

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-16 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 17:40 checking for "config" file existence Jeffrin Jose T
2020-11-16 18:32 ` Shuah Khan
2020-11-16 19:10   ` Jeffrin Jose T

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®