Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 1.37 KB

README.md

File metadata and controls

64 lines (43 loc) · 1.37 KB

go-os-brick: go-os-brick is Go port of os-brick

Go Reference

Usage

go-os-brick provide function that connect / disconnect iSCSI volume.

  • for multi path
    • ConnectMultiPathVolume()
    • DisconnectVolume()
  • for single path
    • ConnectSinglePathVolume()
    • DisconnectSinglePathVolume()

Prepare

go-os-brick execute a some commands. please install before use.

  • iscsiadm(8)
  • blockdev(8)
  • qemu-img(1)
    • if you use QEMUToRaw()
  • multipath(8)
    • if you use multi path

Testing

using gostor/gotgt

backend is gostor/gotgt via goroutine. This test need some kernel modules.

$ sudo go test -v ./...

using open-iscsi targetd in a host machine

WARNING: DO NOT EXECUTE YOUR WORKSPACE!!

This test execute script in a host.

backend is open-iscsi targetd in a host machine. This test need some kernel modules.

$ sudo go test -tags=host -v ./...

using real iSCSI target endpoint

you can use real iSCSI target as backend for testing.

please set environment value

  • OS_BRICK_TEST_PORTAL_ADDRESS
  • OS_BRICK_TEST_TARGET_IQN
$ export OS_BRICK_TEST_PORTAL_ADDRESS="192.0.2.1"
$ export ...
$ sudo go test -v ./...