Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Do not trim from PATH if we did not append to it; Clean up/fix shebangs in scripts #1233

Merged
merged 3 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions clear/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/python -u

import click
import os
import subprocess
Expand Down
3 changes: 0 additions & 3 deletions config/kube.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/python -u
# -*- coding: utf-8 -*-

import fcntl
import os
import shutil
Expand Down
2 changes: 0 additions & 2 deletions connect/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/python -u

import click
import os
import pexpect
Expand Down
2 changes: 0 additions & 2 deletions counterpoll/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/python -u

import click
import json
import swsssdk
Expand Down
3 changes: 0 additions & 3 deletions debug/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#! /usr/bin/python -u
# date: 07/12/17

import click
import subprocess

Expand Down
2 changes: 0 additions & 2 deletions pfcwd/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/python -u

import os
import sys

Expand Down
3 changes: 2 additions & 1 deletion scripts/aclshow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
using aclshow to display SONiC switch acl rules and counters

Expand Down
2 changes: 1 addition & 1 deletion scripts/dump_nat_entries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

""""
Description: dump_nat_entries.py -- dump conntrack nat entries from kernel into a file
Expand Down
3 changes: 2 additions & 1 deletion scripts/ecnconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
ecnconfig is the utility to

Expand Down
3 changes: 2 additions & 1 deletion scripts/fanshow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to show fan status.
"""
Expand Down
3 changes: 2 additions & 1 deletion scripts/fdbclear
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to clear MAC/FDB entries learnt in Hardware

Expand Down
3 changes: 2 additions & 1 deletion scripts/fdbshow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to show MAC/FDB entries learnt in Hardware

Expand Down
2 changes: 1 addition & 1 deletion scripts/gearboxutil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python
#!/usr/bin/env python

import swsssdk
import sys
Expand Down
2 changes: 1 addition & 1 deletion scripts/intfutil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python
#!/usr/bin/env python

import argparse
import os
Expand Down
3 changes: 2 additions & 1 deletion scripts/mmuconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
mmuconfig is the utility to show and change mmu configuration

Expand Down
3 changes: 2 additions & 1 deletion scripts/natclear
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to clear nat dynamic entries from Hardware and also to clear the nat statistics

Expand Down
2 changes: 1 addition & 1 deletion scripts/natconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to show nat configuration
Expand Down
2 changes: 1 addition & 1 deletion scripts/natshow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to show nat entries and nat statistics in a summary view
Expand Down
3 changes: 2 additions & 1 deletion scripts/nbrshow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to show Ipv4/Ipv6 neighbor entries

Expand Down
3 changes: 2 additions & 1 deletion scripts/portconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
portconfig is the utility to show and change ECN configuration

Expand Down
2 changes: 1 addition & 1 deletion scripts/psushow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python
#!/usr/bin/env python

import argparse
import sys
Expand Down
3 changes: 2 additions & 1 deletion scripts/sfpshow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to show sfp eeprom and presence status.
Not like sfputil this scripts get the sfp data from DB directly.
Expand Down
3 changes: 2 additions & 1 deletion scripts/sonic-kdump-config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

'''
Copyright 2019 Broadcom. The term "Broadcom" refers to Broadcom Inc.
and/or its subsidiaries.
Expand Down
3 changes: 2 additions & 1 deletion scripts/sonic_sku_create.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
usage: sonic_sku_create.py [-h] [-v] [-f FILE] [-m [MINIGRAPH_FILE]] [-b BASE]
[-r] [-k HWSKU]
Expand Down
3 changes: 2 additions & 1 deletion scripts/tempershow
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/python
#!/usr/bin/env python

"""
Script to show fan status.
"""
Expand Down
2 changes: 1 addition & 1 deletion scripts/watermarkstat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python

#####################################################################
#
Expand Down
3 changes: 0 additions & 3 deletions show/kube.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/python -u
# -*- coding: utf-8 -*-

import os

import click
Expand Down
2 changes: 0 additions & 2 deletions show/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/python -u

import json
import netaddr
import os
Expand Down
2 changes: 0 additions & 2 deletions sonic_installer/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/python -u

try:
import ConfigParser as configparser
except ImportError:
Expand Down
2 changes: 0 additions & 2 deletions tests/crm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,6 @@ def test_crm_show_resources_nexthop(self):
@classmethod
def teardown_class(cls):
print("TEARDOWN")
os.environ["PATH"] = os.pathsep.join(os.environ["PATH"].split(os.pathsep)[:-1])
os.environ["UTILITIES_UNIT_TESTING"] = "0"

class TestCrmMultiAsic(object):
Expand Down Expand Up @@ -1295,7 +1294,6 @@ def test_crm_multi_asic_show_resources_nexthop(self):
@classmethod
def teardown_class(cls):
print("TEARDOWN")
os.environ["PATH"] = os.pathsep.join(os.environ["PATH"].split(os.pathsep)[:-1])
os.environ["UTILITIES_UNIT_TESTING"] = "0"
os.environ["UTILITIES_UNIT_TESTING_TOPOLOGY"] = ""
import mock_tables.mock_single_asic
1 change: 0 additions & 1 deletion tests/sflow_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,4 @@ def test_config_sflow_intf_sample_rate(self):
@classmethod
def teardown_class(cls):
print("TEARDOWN")
os.environ["PATH"] = os.pathsep.join(os.environ["PATH"].split(os.pathsep)[:-1])
os.environ["UTILITIES_UNIT_TESTING"] = "0"
1 change: 0 additions & 1 deletion tests/show_breakout_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ def test_single_intf_current_mode(self):
@classmethod
def teardown_class(cls):
print("TEARDOWN")
os.environ["PATH"] = os.pathsep.join(os.environ["PATH"].split(os.pathsep)[:-1])
os.environ["UTILITIES_UNIT_TESTING"] = "0"
1 change: 0 additions & 1 deletion tests/show_platform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@ def test_summary(self):
@classmethod
def teardown_class(cls):
print("TEARDOWN")
os.environ["PATH"] = os.pathsep.join(os.environ["PATH"].split(os.pathsep)[:-1])
os.environ["UTILITIES_UNIT_TESTING"] = "0"
2 changes: 0 additions & 2 deletions tests/system_health_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/python -u

import sys
import os

Expand Down
3 changes: 0 additions & 3 deletions undebug/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#! /usr/bin/python -u
# date: 07/12/17

import click
import subprocess

Expand Down