The game against the Spanish club will take place at the Walkers Stadium on August 2, kick-off at 3pm.
It will be the Foxes sixth and final run-out ahead of their Championship opener at home to Swansea on August 8.
Chairman Milan Mandaric told the club's official website: "It is going to serve two purposes. Firstly, to give our manager and team a good test against a good skilful team from the top flight in Spain and also, importantly, to let our supporters see the quality of the team they will be getting behind in the very important season ahead.
"They will be able to see all the new players and the way the squad will be gelling into what we hope will be a very competitive team."