Alien-Libjio
view release on metacpan or search on metacpan
libjio/UPGRADING view on Meta::CPAN
- Structures are now opaque types:
struct jfs -> jfs_t; jopen() returns a pointer to one, jclose() frees it.
struct jtrans -> jtrans_t; jtrans_new() returns a pointer to one,
jtrans_free() frees it.
- Renamed jtrans_init() to jtrans_new().
- jtrans_commit() returns -1 on recovered errors, -2 on unrecovered errors
(which are an indication of a severe underlying condition).
- jtrans_add() returns 0 on success and -1 on errors (it used to return 1 on
success and 0 on errors).
- jfsck() now has an additional "flags" parameter, which should be set to 0
to select the default behaviour.
- jfsck_cleanup() was removed, and now jfsck() cleans up by default.
-> 0.25
- It is no longer necessary to pass O_SYNC to jopen() if lingering
transactions are not in use.
- libjio.h can no longer be included from C++ source without surrounding it
by an 'extern "C"'. This obviously should only affect C++ applications.
-> 0.24
- The return values of jfsck() have changed, so applications using it need
libjio/tests/stress/jiostress view on Meta::CPAN
"""
This application is a stress tester for libjio. It's not a traditional stress
test like fsx (which can be used to test libjio using the preloading library),
but uses fault injection to check how the library behaves under random
failures.
"""
import sys
import os
import time
import select
import random
import fcntl
import traceback
from optparse import OptionParser
import libjio
try:
import fiu
except ImportError:
print()
libjio/tests/stress/jiostress view on Meta::CPAN
FAILURE = bytes('0', encoding = 'ascii')
def feed(self, success = True):
if success:
os.write(self.w, OutputHandler.SUCCESS)
else:
os.write(self.w, OutputHandler.FAILURE)
def output_loop(self):
while self.rs:
rr, rw, rx = select.select(self.rs, [], [], 1)
for r in rr:
d = os.read(r, 1)
if not d:
self.rs.remove(r)
else:
self.ntrans[r] += 1
if d == OutputHandler.FAILURE:
self.nfailures[r] += 1
self.cond_print()
libjio/tests/stress/jiostress view on Meta::CPAN
help = "do not lock internally, disables verification")
parser.add_option("", "--no-verify", dest = "do_verify",
action = "store_false", default = True,
help = "do not perform verifications")
parser.add_option("", "--keep", dest = "keep",
action = "store_true", default = False,
help = "keep the file after completing the test")
parser.add_option("", "--force", dest = "force",
action = "store_true", default = False,
help = "force the tests to run, even if conflicting"
+ " options are selected")
options, args = parser.parse_args()
if len(args) != 2:
parser.print_help()
return 1
fname = args[0]
try:
fsize = int(args[1]) * 1024 * 1024
( run in 1.158 second using v1.01-cache-2.11-cpan-49f99fa48dc )