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

test case(authentication): get user token #5

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

bhaskarhc
Copy link
Contributor

@bhaskarhc bhaskarhc commented Aug 18, 2020

Test Kubera local authentication using user credentials

How to run the test :

  • Credentials and Kubera host details need to set as environment variables
KUBERA_HOST="<Kubera_IP>" \
  KUBERA_USER="<kubera_user_name>" \
  KUBERA_PASS="<kubera_user_password>" \
  go test ./... 

Folder Structure

|_ kubera-api-testing/
    |__ kubera/
    |   |__ connection/
    |   |    |__ connection.go
    |   |__ authentication/
    |        |__ authentication_test.go
    |        |__ authentication.go
    |__ go.mod
    |__ go.sum
    |__ makefile

Scenarios

{
		"No host": {
			Username: UserName,
			Password: Password,
			IsError:  true,
		},
		"No username": {
			Hostname: HostName,
			Password: Password,
			IsError:  true,
		},
		"No password": {
			Hostname: HostName,
			Username: UserName,
			IsError:  true,
		},
		"With host, username & password": {
			Hostname: HostName,
			Username: UserName,
			Password: Password,
		},
		"With host, username & invalid password": {
			Hostname: HostName,
			Username: UserName,
			Password: "invalid",
			IsError:  true,
		},
		"With invalid host, username & password": {
			Hostname: "invalid",
			Username: UserName,
			Password: Password,
			IsError:  true,
		},
		"With host, invalid username & password": {
			Hostname: HostName,
			Username: "invalid",
			Password: Password,
			IsError:  true,
		},
	}

Output

bhaskarjb@Bhaskars-MBP:~/Desktop/mayadata-io/kubera-api-testing|get-user-data 
⇒  KUBERA_HOST="http://15.207.111.248/" KUBERA_USER="[email protected]" KUBERA_PASS="[email protected]" go test ./...    
ok  	github.com/mayadata-io/kubera-api-testing/kubera/authentication	(cached)
?   	github.com/mayadata-io/kubera-api-testing/kubera/connection	[no test files]

testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
@AmitKumarDas AmitKumarDas changed the title Get user Details [wip] authentication: get user details Aug 19, 2020
testing_api/Makefile Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
testing_api/rest.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
kubera/authentication/signup.txt Outdated Show resolved Hide resolved
@bhaskarhc bhaskarhc changed the title [wip] authentication: get user details [wip] authentication: get user Token Aug 24, 2020
Copy link

@harshshekhar15 harshshekhar15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Contributor

@amitbhatt818 amitbhatt818 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@bhaskarhc bhaskarhc changed the title [wip] authentication: get user Token authentication: get user Token Aug 25, 2020
Copy link
Contributor

@rohan2794 rohan2794 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Makefile Outdated Show resolved Hide resolved
@AmitKumarDas AmitKumarDas changed the title authentication: get user Token test case(authentication): get user token Aug 25, 2020
Copy link
Contributor

@amitbhatt818 amitbhatt818 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@AmitKumarDas AmitKumarDas merged commit fc17c0d into mayadata-io:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants