Skip to content
Frank V. Castellucci edited this page Jan 31, 2018 · 31 revisions

Overviews, notes, etc. for sawtooth-uom development

Housekeeping

How I reset my environment to get to version 1.0 of HL/ST.

Sawtooth platform

  1. Remove all docker images using this command docker rmi -f $(docker images -a -q)
  2. Bring down the latest sawtooth compose file sawtooth-default.yaml
  3. Execute compose docker-compose -f ~/sawtooth.misc/sawtooth-default.yaml up

Sawtooth sdk repo (sawtooth-core)

  1. Clone the latest repository
  2. Go to the root directory of the repo cd ~\sawtooth-core
  3. At a minimum do bin\build_all -l python

UOM Python Standard Development and Testing

  1. Clone the latest repository
  2. Go to the root directory of the repo cd ~\sawtooth-uom
  3. Wait for further instructions

Unit Testing

Running sawtooth settings tests

Run test

Add an test_tp_settings_override.yaml file with the following content to prevent the test container from exiting.

version: "2.1"

services:

  test-tp-settings:
    command: ["tail", "-f", "/dev/null"]

Run the following command in one shell.

export SAWTOOTH_CORE=$(pwd)
export ISOLATION_ID=latest
docker-compose -p latest -f ./families/settings/tests/test_tp_settings.yaml -f ./families/settings/tests/test_tp_settings_override.yaml up

In a second shell run the following command to open a shell to the test container.

docker-compose -p latest -f ./families/settings/tests/test_tp_settings.yaml exec test-tp-settings bash

Run python3 in the container and then execute a test.

>>> import unittest
>>> from test_tp_settings import *
>>> ts=unittest.TestSuite()
>>> ts.addTest(TestSettings('test_allow_set_authorized_keys_when_initially_empty'))
>>> tr=unittest.TestResult()
>>> ts.run(tr)

import test to python in a container

Export PYTHONPATH to the python module folders.

export PYTHONPATH=${PYTHONPATH}:/project/sawtooth-core/families/settings:/project/sawtooth-core/families/settings/sawtooth_settings:/project/sawtooth-core/sdkpythonbuildlib:/project/sawtooth-core/sdk/python/build/lib:/project/sawtooth-core/signing/build/lib
Clone this wiki locally