Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert changes to the user agent #6993

Merged
merged 1 commit into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions test/sharness/t0026-id.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

test_description="Test to make sure our identity information looks sane"

. lib/test-lib.sh

test_init_ipfs

test_id_compute_agent() {
AGENT_VERSION="$(ipfs version --number)" || return 1
AGENT_COMMIT="$(ipfs version --number --commit)" || return 1
if test "$AGENT_COMMIT" = "$AGENT_VERSION"; then
AGENT_COMMIT=""
else
AGENT_COMMIT="${AGENT_COMMIT##$AGENT_VERSION-}"
fi
echo "go-ipfs/$AGENT_VERSION/$AGENT_COMMIT"
}

test_expect_success "checking AgentVersion" '
test_id_compute_agent > expected-agent-version &&
ipfs id -f "<aver>\n" > actual-agent-version &&
test_cmp expected-agent-version actual-agent-version
'

test_expect_success "checking ProtocolVersion" '
echo "ipfs/0.1.0" > expected-protocol-version &&
ipfs id -f "<pver>\n" > actual-protocol-version &&
test_cmp expected-protocol-version actual-protocol-version
'

test_expect_success "checking ID" '
ipfs config Identity.PeerID > expected-id &&
ipfs id -f "<id>\n" > actual-id &&
test_cmp expected-id actual-id
'

test_done
4 changes: 3 additions & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ const CurrentVersionNumber = "0.5.0-dev"
const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/"

// UserAgent is the libp2p user agent used by go-ipfs.
var UserAgent = ApiVersion + CurrentCommit
//
// Note: This will end in `/` when no commit is available. This is expected.
var UserAgent = "go-ipfs/" + CurrentVersionNumber + "/" + CurrentCommit