"ls -d" doesn't display directories. Is used to list directory's name instead of directory's content if the argument passed to ls is a directory.
For example, if you have a directory called TEST and you issue "ls TEST", you will see the list of files in that directory. If you issue "ls -d TEST" you will see only the name of the directory you searched for (TEST).
Hi I have 2 Solaris boxes A and B, A running solaris 9, and B running solaris 6.
when i try to use rcp on A like this:-
A> rcp file.txt B:/path/file.txt
I get into standard input and nothing happens!!
Then On the target machine B, if i try,
B> rcp otherfile.txt B:/path/otherfile.txt... (1 Reply)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Hi again everyone.
I have recently installed Solaris 10 on a server. Everything seems to work fine (users can be added and can log in, internet connectivity works, etc). However I'm struggling to get mail or mailx to work.
Say there are two users on my server, Bob and Mary. Server hostname... (3 Replies)
Hi to all!
I want to learn step by step easily how to configure my Solaris for network. I know alot about Solaris Network configuration. But I have some problems.
When I install Solaris, and I plug-in my network cable to Solaris. Then I run:
ifconfig -a plumb
then I do
ifconfig bge0 dhcp... (7 Replies)
grep -e doesn't work in Soalris.
Same script with grep -e worked on AIX/HP/LINUX..
I would like to search a list of patterns on "log.txt" like ...
grep -e FATAL -e ERROR log.txt
I get the error message as
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . . (3 Replies)
Hi Forum,
I updated my Solaris 10 (10/09) with the current Oracle patch file and moved the smb.conf to /etc/samba/smb.conf.
Anyway, since patching, no Windows client is able to connect the share. It says password is wrong, but its the right pw.
My smb.conf:
bash-3.00# cat... (4 Replies)
Hi All,
I am using a solaris Sun-Fire-V440 server.
The OS is solaris.
My problem is whenever I run the command
mount | grep "^/ " | sed -e 's,^.*dsk/\(*\).*$,\1,'
it should return a disk value as "d30" as it does on each of my other servers.But on this server I am not getting any o/p from... (3 Replies)
Hello Experts,
I am performing performance tests on a few mysql select queries.
I use the following command to clear the memory disk caches.
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
I however see that the above command works on RHEL6 but doesn't work on Solaris 10.
I asked... (4 Replies)
Hi,
I am using korn shell.
until ]
do
echo "\$# = " $#
echo "$1"
shift
done
To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work.
Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies
LEARN ABOUT DEBIAN
py.test
PY.TEST(1) pytest PY.TEST(1)NAME
pytest - pytest usage
CALLING PY.TEST THROUGH PYTHON -M PY.TEST
New in version 2.0.
If you use Python-2.5 or later you can invoke testing through the Python interpreter from the command line:
python -m pytest [...]
This is equivalent to invoking the command line script py.test [...] directly.
GETTING HELP ON VERSION, OPTION NAMES, ENVIRONMENT VARIABLES
py.test --version # shows where pytest was imported from
py.test --funcargs # show available builtin function arguments
py.test -h | --help # show help on command line and config file options
STOPPING AFTER THE FIRST (OR N) FAILURES
To stop the testing process after the first (N) failures:
py.test -x # stop after first failure
py.test --maxfail=2 # stop after two failures
SPECIFYING TESTS / SELECTING TESTS
Several test run options:
py.test test_mod.py # run tests in module
py.test somepath # run all tests below path
py.test -k string # only run tests whose names contain a string
Import 'pkg' and use its filesystem location to find and run tests:
py.test --pyargs pkg # run all tests found below directory of pypkg
MODIFYING PYTHON TRACEBACK PRINTING
Examples for modifying traceback printing:
py.test --showlocals # show local variables in tracebacks
py.test -l # show local variables (shortcut)
py.test --tb=long # the default informative traceback formatting
py.test --tb=native # the Python standard library formatting
py.test --tb=short # a shorter traceback format
py.test --tb=line # only one line per failure
DROPPING TO PDB (PYTHON DEBUGGER) ON FAILURES
Python comes with a builtin Python debugger called PDB. py.test allows one to drop into the PDB prompt via a command line option:
py.test --pdb
This will invoke the Python debugger on every failure. Often you might only want to do this for the first failing test to understand a
certain failure situation:
py.test -x --pdb # drop to PDB on first failure, then end test session
py.test --pdb --maxfail=3 # drop to PDB for the first three failures
SETTING A BREAKPOINT / AKA SET_TRACE()
If you want to set a breakpoint and enter the pdb.set_trace() you can use a helper:
import pytest
def test_function():
...
pytest.set_trace() # invoke PDB debugger and tracing
In previous versions you could only enter PDB tracing if you disabled capturing on the command line via py.test -s.
PROFILING TEST EXECUTION DURATION
To get a list of the slowest 10 test durations:
py.test --durations=10
CREATING JUNITXML FORMAT FILES
To create result files which can be read by Hudson or other Continuous integration servers, use this invocation:
py.test --junitxml=path
to create an XML file at path.
CREATING RESULTLOG FORMAT FILES
To create plain-text machine-readable result files you can issue:
py.test --resultlog=path
and look at the content at the path location. Such files are used e.g. by the PyPy-test web page to show test results over several revi-
sions.
SENDING TEST REPORT TO POCOO PASTEBIN SERVICE
Creating a URL for each test failure:
py.test --pastebin=failed
This will submit test run information to a remote Paste service and provide a URL for each failure. You may select tests as usual or add
for example -x if you only want to send one particular failure.
Creating a URL for a whole test session log:
py.test --pastebin=all
Currently only pasting to the http://paste.pocoo.org service is implemented.
CALLING PY.TEST FROM PYTHON CODE
New in version 2.0.
You can invoke py.test from Python code directly:
pytest.main()
this acts as if you would call "py.test" from the command line. It will not raise SystemExit but return the exitcode instead. You can
pass in options and arguments:
pytest.main(['x', 'mytestdir'])
or pass in a string:
pytest.main("-x mytestdir")
You can specify additional plugins to pytest.main:
# content of myinvoke.py
import pytest
class MyPlugin:
def pytest_addoption(self, parser):
raise pytest.UsageError("hi from our plugin")
pytest.main(plugins=[MyPlugin()])
Running it will exit quickly:
$ python myinvoke.py
ERROR: hi from our plugin
AUTHOR
holger krekel at merlinux eu
COPYRIGHT
2011, holger krekel et alii
2.2 June 24, 2012 PY.TEST(1)