source: TI05-delivery/trunk/test/runclient.py @ 1539

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/trunk/test/runclient.py@1539
Revision 1539, 1.1 KB checked in by spascoe, 13 years ago (diff)

Some bug fixes to auth/authz API.

test_embedded.py now passes (except for the usual testStartup problem).

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2"""
3This script runs the bbftp client using the python-bbftp client wrapper.  We need this
4to test client-server interactions without importing both delivery.bbftpd and delivery.bbftpc
5into the interpreter.
6"""
7
8import os, sys, time
9from glob import glob
10
11
12from ndg.delivery.auth_plugin import AuthClientHandler
13import ndg.delivery.client.pybbftp as DC
14
15
16# Extract the command (-e) since bbftpc doesn't use it any more
17# Allow multiple commands
18args = sys.argv[1:]
19cmds = []
20
21while True:
22    try:
23        ei = args.index('-e')
24    except ValueError:
25        break
26    cmds.append(args[ei+1])
27    args = args[:ei] + args[ei+2:]
28
29try:
30    i = args.index('-P')
31except ValueError:
32    privatestr = "none"
33    pass
34else:
35    privatestr = args[i+1]
36    args = args[:i] + args[i+2:]
37
38ach = AuthClientHandler(DC.ClientConnector(), privatestr)
39
40print "** runclient.py: connecting with args %s" % args
41msgs = DC.connect(ach, args)
42for msg in msgs:
43    print msg.rstrip()
44   
45for cmd in cmds:
46    print "** runclient.py: doing %s" % cmd
47    msgs = DC.docommand(cmd)
48    for msg in msgs:
49        print msg.rstrip()
50DC.close()
Note: See TracBrowser for help on using the repository browser.