checking for "config" file existence.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



#!/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")

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux