require 'net/ldap'
class LDAPConn
HOST = "ldap.yourcorp.dev"
# 636 for ssl binding
PORT = "636"
USERNAME = "TestLDAP"
PASSWORD = "abcd1234"
TREEBASE = "OU=UserAccts,DC=yourdomain,DC=com"
def LDAPConn.getLDAP
ldap = Net::LDAP.new(:host => HOST,
:port => PORT,
:auth => {
:method => :simple,
:username => USERNAME,
:password => PASSWORD
},
:encryption => :simple_tls)
return ldap
end
def LDAPConn.validateLogin(email, password)
ldap = LDAPConn.getLDAP
filter = Net::LDAP::Filter.eq("mail", email)
result = ldap.bind_as(:base => TREEBASE, :filter => filter, :password => password)
return result
end
end
Sunday, September 15, 2013
LDAP sample in Ruby Code
Wednesday, August 07, 2013
How to do a multipart file upload in ruby
gem install httpclient
require 'httpclient'
require 'uri'
# Do multipart file upload with POST
httpreq = HTTPClient.new
File.open("#{filename}") do |file|
body = { 'year' => "#{curyear}", 'tag' => "#{tagname}", 'uploadfile' => file}
res = httpreq.post(URI("#{uri}"), body)
end
Wednesday, July 31, 2013
ActiveMQ Jmeter Test Plan on my github
Recently, i am testing the our message queue capacity and performance which is ActiveMQ...So i made a sample Jmeter test plan on my github, once someone want take a reference:
https://github.com/joychester/ActiveMQJMeterTestPlan
This reminds me one of my report issue to JMeter JMS Sampler 3 years ago :) Time flies!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=49111
https://github.com/joychester/ActiveMQJMeterTestPlan
This reminds me one of my report issue to JMeter JMS Sampler 3 years ago :) Time flies!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=49111
Wednesday, May 01, 2013
"PetGym" is on my github now -- Automated your Jmeter tests
Jmeter PluginCMD provide a capability for running jmeter tests automatically with many cool reports generated:
http://code.google.com/p/jmeter-plugins/wiki/JMeterPluginsCMD
I am writing a ruby program to meet my basic requirement during my performance tests.
Please check it out if you want to give it a try: https://github.com/joychester/PetGym
I am writing a ruby program to meet my basic requirement during my performance tests.
Please check it out if you want to give it a try: https://github.com/joychester/PetGym
Thursday, April 18, 2013
FastMole is on my GitHub now!
FastMole which is one of my project to do Continuous Page performance tests is on my github now:
https://github.com/joychester/FastMole
Tuesday, April 09, 2013
Generate Load by adding reasonable think time
I used to generate load by launching small number of VUs without any think time during performance testing.
The pros is You can trigger a very high load/Throughput even you are not creating many concurrent threads, but the cons is you can not generate consistent/stable load to make comparison once you make some tuning or changes.
Recently, I am discussing with my teammate ZhouZhou, and figure out how we generate a consistent load by adding reasonable think time(Little Law helps the calculation here) between each request, here is the diagram we made to show how much load/Throughput we can generate/get:
Subscribe to:
Posts (Atom)