
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Testing TCP program, following the Perl's Test::TCP include memcached and redis test server.
tcptest is following Perl's "Test::TCP".
It has the methods like original one, but also has another TestServer implementation.
This package also includes memcached and redis test server support.
.. code-block:: python
import tcptest.memcached import tcptest.redis import tcptest.fluentd
with tcptest.memcached.Server() as server: memd = memcache.Client(['127.0.0.1:%d' % server.port]) ...
with tcptest.redis.Server() as server: db = redis.Redis(host='127.0.0.1', port=server.port, db=0) ...
with tcptest.fluentd.Server() as server: import fluentd.sender import fluentd.event fluent.sender.setup('app', port=server.port) fluent.event.Event('follow', {'foo': 'bar'}) fluent.event.Event('label', {'hoge': 'fuga'}) print server.logs
server = tcptest.memcached.Server() server.start() ... server.stop()
custom server
.. code-block:: python
import tcptest
class YourTestServer(tcptest.TestServer):
def build_command(self):
return ('your server command', 'arg1', 'arg2', ...)
with YourTestServer() as server:
# your server works on server.port
...
capture server outputs
.. code-block:: python
import tcptest.redis
res = {} with tcptest.redis.Server(res=res) as server: ... stdout = res['stdout'] stderr = res['stderr']
redis options
.. code-block:: python
import tcptest.redis
with tcptest.redis.Server(settings=dict(databases=4)) as server:
...
redis replication
.. code-block:: python
import tcptest.redis
master = tcptest.redis.Server() master.start()
slave_settings = {'slaveof': 'localhost %d' % master.port} slave = tcptest.redis.Server(settings=slave_settings) slave.start()
0.6.0 - 2015/10/29
- Support Python3 (thanks ikegami-yukino)
- Improve redis-server port reserve, to support redis cluster
0.5.0 - 2015/06/12
0.4.0 - 2014/04/05
- Support fluentd test server
0.3.0 - 2014/01/28
0.2.4 - 2013/07/16
- Fix pip installation
- Add MANIFEST.in
0.2.1-3 - 2013/05/27
0.2.0 - 2013/05/21
- Support Redis test server
0.1.0 - 2013/05/21
.. image :: https://travis-ci.org/nekoya/python-tcptest.png?branch=master
FAQs
Testing TCP program, following the Perl's Test::TCP include memcached and redis test server.
We found that tcptest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.