Example #1
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp/new-symlink'),
         th.writes(err, '/tmp/other-link'),
         th.count_writes(err, 2),
         th.count_readdir(err, 0),
     ])
Example #2
0
def passes(out, err):
    return all([
        th.mkdirs(err, '/tmp/subdirnew'),
        th.count_mkdir(err, 1),
        th.count_writes(err, 0),
        th.count_readdir(err, 0),
    ])
Example #3
0
def passes(out, err):
    return all([
        th.writes(err, '/tmp/barbaz'),
        th.writes(err, '/tmp/silly-file'),
        th.count_writes(err, 2),
        th.count_readdir(err, 0),
    ])
Example #4
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/kill-self.sh'),
         th.writes(err, 'tmp/foo'),
         th.count_writes(err, 1),
         th.reads(err, '/tmp/root_symlink'),
     ])
Example #5
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/vforks.test'),
        th.writes(err, '/tmp.vforks'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #6
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/rename-over-symlink.test'),
        th.writes(err, '/tmp/root_symlink'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #7
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/forks.test'),
         th.writes(err, '/tmp/subdir1/deepdir/forks'),
         th.count_writes(err, 1),
         th.count_readdir(err, 0),
     ])
Example #8
0
def passes(out, err):
    return all(
        [th.mkdirs(err, '/tmp/subdirnew'),
         th.count_mkdir(err, 1),
         th.count_writes(err, 0),
         th.count_readdir(err, 0),
     ])
Example #9
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/forks.test'),
        th.writes(err, '/tmp/subdir1/deepdir/forks'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #10
0
def passes(out, err):
    return all([
        th.writes(err, '/tmp/openat'),
        th.count_mkdir(err, 0),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #11
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/fopen.test'),
        th.writes(err, '/tmp/foo'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #12
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/rename.test'),
        th.writes(err, '/tmp/barbaz'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #13
0
def passes(out, err):
    return all([
        th.writes(err, '/tmp/new-symlink'),
        th.writes(err, '/tmp/other-link'),
        th.count_writes(err, 2),
        th.count_readdir(err, 0),
    ])
Example #14
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/long-path.sh'),
         th.count_writes(err, 80),
         th.reads(err, '/tmp/root_symlink'),
         th.writes(err, 'tmp/dirfoo/dirfoo/dirfoo/dir foo/dir  foo/dir   foo/dir    foo/dir     foo/dir      foo/dir       foo/dir        foo/dir         foo/dir          foo/dir           foo/dir            foo/dir             foo/dir              foo/dir               foo/dir                foo/dir                 foo/dir                  foo/dir                   foo/dir                    foo/dir                     foo/dir                      foo/dir                       foo/dir                        foo/dir                         foo/dir                          foo/dir                           foo/dir                            foo/dir                             foo/dir                              foo/dir                               foo/file                               .dat'),
     ])
Example #15
0
def passes(out, err):
    return all([
        th.writes(err, '/tmp/subdir1/foo_symlink'),
        th.writes(err, '/tmp/subdir1/openat'),
        th.count_writes(err, 2),
        th.count_readdir(err, 0),
    ])
Example #16
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp/barbaz'),
         th.writes(err, '/tmp/silly-file'),
         th.count_writes(err, 2),
         th.count_readdir(err, 0),
     ])
Example #17
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/broken-symlink.test'),
        th.writes(err, '/tmp/other-link'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #18
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp/subdir1/foo_symlink'),
         th.writes(err, '/tmp/subdir1/openat'),
         th.count_writes(err, 2),
         th.count_readdir(err, 0),
     ])
Example #19
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/kill-self.sh'),
        th.writes(err, 'tmp/foo'),
        th.count_writes(err, 1),
        th.reads(err, '/tmp/root_symlink'),
    ])
Example #20
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp/openat'),
         th.count_mkdir(err, 0),
         th.count_writes(err, 1),
         th.count_readdir(err, 0),
     ])
Example #21
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/truncate.sh'),
        th.count_writes(err, 2),
        th.reads(err, '/tmp/root_symlink'),
        th.writes(err, '/tmp/foo'),
        th.writes(err, '/tmp/foobar'),
    ])
Example #22
0
def passes_windows(out, err):
    print('out:\n' + out)
    print('err:\n' + err)
    return all([
        th.reads(err, r'\tests\pyrename-test.py'),
        th.writes(err, r'\tmp\hello-final'),
        th.count_writes(err, 1),
    ])
Example #23
0
def passes_windows(out, err):
    print('out:\n' + out)
    print('err:\n' + err)
    return all(
        [th.reads(err, r'\tests\pyrename-test.py'),
         th.writes(err, r'\tmp\hello-final'),
         th.count_writes(err, 1),
     ])
Example #24
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/truncate.sh'),
         th.count_writes(err, 2),
         th.reads(err, '/tmp/root_symlink'),
         th.writes(err, '/tmp/foo'),
         th.writes(err, '/tmp/foobar'),
     ])
Example #25
0
def passes_windows(out, err):
    print('out:\n' + out)
    print('err:\n' + err)
    return all([
        th.writes(err, r'\tmp\barbaz'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #26
0
def passes_windows(out, err):
    print('out:\n' + out)
    print('err:\n' + err)
    return all(
        [th.writes(err, r'\tmp\barbaz'),
         th.writes(err, '/tmp/silly-file'),
         th.count_writes(err, 2),
         th.count_readdir(err, 0),
     ])
Example #27
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/linkat.test'),
         th.reads(err, '/tests/null.test'),
         th.writes(err, '/tmp/subdir2/hidden/awesome'),
         th.mkdirs(err, '/tmp/subdir2/hidden'),
         th.count_writes(err, 1),
         th.count_readdir(err, 0),
     ])
Example #28
0
def passes_windows(out, err):
    print('out:\n' + out)
    print('err:\n' + err)
    return all([
        th.count_writes(err, 2),
        th.doesnt_write(err, r'\tmp\subdir2\hello'),
        th.doesnt_read(err, r'\tmp\subdir2\test'),
        th.writes(err, r'\tmp\newdir\hello'),
        th.writes(err, r'\tmp\newdir\test'),
    ])
Example #29
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp/subdirnew/subfile'),
         th.writes(err, '/tmp/useless'),
         th.mkdirs(err, '/tmp/subdirnew'),
         th.mkdirs(err, '/tmp/subdirnew/subsub'),
         th.count_mkdir(err, 2),
         th.count_writes(err, 2),
         th.count_readdir(err, 0),
     ])
Example #30
0
def passes(out, err):
    return all([
        th.writes(err, '/tmp/subdirnew/subfile'),
        th.writes(err, '/tmp/useless'),
        th.mkdirs(err, '/tmp/subdirnew'),
        th.mkdirs(err, '/tmp/subdirnew/subsub'),
        th.count_mkdir(err, 2),
        th.count_writes(err, 2),
        th.count_readdir(err, 0),
    ])
Example #31
0
def passes_windows(out, err):
    print('out:\n' + out)
    print('err:\n' + err)
    return all(
        [th.count_writes(err, 2),
         th.doesnt_write(err, r'\tmp\subdir2\hello'),
         th.doesnt_read(err, r'\tmp\subdir2\test'),
         th.writes(err, r'\tmp\newdir\hello'),
         th.writes(err, r'\tmp\newdir\test'),
     ])
Example #32
0
def passes_windows(out, err):
    '''Some day I want this to register

    th.reads(err, r'\tests\null-test.exe'),

    but for now we aren't tracking the creation of processes.
    '''
    return all([
        th.count_writes(err, 0),
        th.count_readdir(err, 0),
    ])
Example #33
0
def passes(out, err):
    return all(
        [th.reads(err, '/tmp/foo'),
         th.reads(err, '/tmp/subdir1/foo_symlink'),
         th.writes(err, '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'),
         th.mkdirs(err, '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'),
         th.mkdirs(err, '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'),
         th.mkdirs(err, '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'),
         th.count_writes(err, 1),
         th.count_readdir(err, 0),
     ])
Example #34
0
def passes_windows(out, err):
    '''Some day I want this to register

    th.reads(err, r'\tests\null-test.exe'),

    but for now we aren't tracking the creation of processes.
    '''
    return all(
        [th.count_writes(err, 0),
         th.count_readdir(err, 0),
     ])
Example #35
0
def passes(out, err):
    """This test illustrates a limitation of how we handle directory
    renames: we only track changes to files within that directory that
    we have written to or read from.  This means that you cannot take
    the output of two sequential jobs and use it to find the net
    change, since the second job may rename files written to in the
    first job.  In the context of fac, I don't see this being a
    problem.  A complete fix would involve tracking deletions as well
    as writes.

    """
    return all(
        [th.count_writes(err, 2),
         th.doesnt_write(err, '/tmp/subdir2/hello'),
         th.doesnt_read(err, '/tmp/subdir2/test'),
         th.writes(err, '/tmp/newdir/hello'),
         th.writes(err, '/tmp/newdir/test'),
     ])
Example #36
0
def passes(out, err):
    """This test illustrates a limitation of how we handle directory
    renames: we only track changes to files within that directory that
    we have written to or read from.  This means that you cannot take
    the output of two sequential jobs and use it to find the net
    change, since the second job may rename files written to in the
    first job.  In the context of fac, I don't see this being a
    problem.  A complete fix would involve tracking deletions as well
    as writes.

    """
    return all([
        th.count_writes(err, 2),
        th.doesnt_write(err, '/tmp/subdir2/hello'),
        th.doesnt_read(err, '/tmp/subdir2/test'),
        th.writes(err, '/tmp/newdir/hello'),
        th.writes(err, '/tmp/newdir/test'),
    ])
Example #37
0
def passes(out, err):
    return all([
        th.reads(err, '/tmp/foo'),
        th.reads(err, '/tmp/subdir1/foo_symlink'),
        th.writes(
            err,
            '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'
        ),
        th.mkdirs(
            err,
            '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'
        ),
        th.mkdirs(
            err,
            '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'
        ),
        th.mkdirs(
            err,
            '/tmp/subdir1/abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'
        ),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #38
0
def passes(out, err):
    return all([
        th.count_writes(err, 0),
        th.count_readdir(err, 0),
    ])
Example #39
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp/still-running'),
         th.count_writes(err, 1),
         th.count_readdir(err, 0),
     ])
Example #40
0
def passes_windows(out, err):
    return all([
        th.writes(err, r'\tmp\foo'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #41
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp.vforks'),
         th.count_writes(err, 1),
         th.count_readdir(err, 0),
     ])
Example #42
0
def passes(out, err):
    return all(
        [th.writes(err, '/tmp/root_symlink'),
         th.count_writes(err, 1),
         th.count_readdir(err, 0),
     ])
Example #43
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/ln-s.sh'),
         th.writes(err, '/tmp-silly'),
         th.count_writes(err, 1),
     ])
Example #44
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/pyrename-test.py'),
         th.writes(err, '/tmp/hello-final'),
         th.count_writes(err, 1),
     ])
Example #45
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/create-many-delete-many.sh'),
         th.count_writes(err, 0),
         th.reads(err, '/tmp/root_symlink'),
     ])
Example #46
0
def passes(out, err):
    return all(
        [th.reads(err, '/tmp/foo'),
         th.count_writes(err, 0),
         th.count_readdir(err, 0),
     ])
def passes(out, err):
    return all([
        th.reads(err, '/tests/create-many-delete-many.sh'),
        th.count_writes(err, 0),
        th.reads(err, '/tmp/root_symlink'),
    ])
Example #48
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/kill-child.sh'),
         th.count_writes(err, 0),
         th.reads(err, '/tmp/root_symlink'),
     ])
Example #49
0
def passes(out, err):
    return all(
        [th.reads(err, '/tests/null.test'),
         th.count_writes(err, 0),
         th.count_readdir(err, 0),
     ])
Example #50
0
def passes(out, err):
    return all([
        th.writes(err, '/tmp/root_symlink'),
        th.count_writes(err, 1),
        th.count_readdir(err, 0),
    ])
Example #51
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/kill-child.sh'),
        th.count_writes(err, 0),
        th.reads(err, '/tmp/root_symlink'),
    ])
Example #52
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/pyrename-test.py'),
        th.writes(err, '/tmp/hello-final'),
        th.count_writes(err, 1),
    ])
Example #53
0
def passes(out, err):
    return all([
        th.reads(err, '/tests/ln-s.sh'),
        th.writes(err, '/tmp-silly'),
        th.count_writes(err, 1),
    ])
Example #54
0
def passes(out, err):
    return all(
        [th.count_mkdir(err, 0),
         th.count_writes(err, 0),
         th.count_readdir(err, 0),
     ])